Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Avoid org.apache.axis2.AxisFault: Error in Encryption (Illegal Key Size or Default Parameters)

DZone's Guide to

How to Avoid org.apache.axis2.AxisFault: Error in Encryption (Illegal Key Size or Default Parameters)

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

This issue comes when your application uses a bigger key size in encryption than the default key size provided by the Java runtime.

Solution:

  1. Download Unlimited Strength Java(TM) Cryptography Extension (JCE) Policy Files for the Java(TM) Platform (based on your JDK version)
  2. Please *.jar files in the following location
    • $JAVA_HOME/jre/lib/security/
[java] Using WS-Security

  [java] 13/12/12 20:12:25 INFO mail.MailTransportSender: MAILTO Sender started

  [java] 13/12/12 20:12:25 INFO jms.JMSSender: JMS Sender started

  [java] 13/12/12 20:12:25 INFO jms.JMSSender: JMS Transport Sender initialized...

  [java] org.apache.axis2.AxisFault: Error in encryption

  [java]   at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:76)

  [java]   at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)

  [java]   at org.apache.axis2.engine.Phase.invoke(Phase.java:313)

  [java]   at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)

  [java]   at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)

  [java]   at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)

  [java]   at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)

  [java]   at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)

  [java]   at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)

  [java]   at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)

  [java]   at samples.userguide.StockQuoteClient.executeClient(Unknown Source)

  [java]   at samples.userguide.StockQuoteClient.main(Unknown Source)

  [java] Caused by: org.apache.rampart.RampartException: Error in encryption

  [java]   at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:612)

  [java]   at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:97)

  [java]   at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)

  [java]   at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)

  [java]   ... 11 more

 [java] Caused by: org.apache.ws.security.WSSecurityException: Cannot encrypt data; nested exception is: 
  [java]   org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters

  [java] Original Exception was java.security.InvalidKeyException: Illegal key size or default parameters

  [java]   at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:608)

  [java]   at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:461)

  [java]   at org.apache.ws.security.message.WSSecEncrypt.encryptForInternalRef(WSSecEncrypt.java:350)

  [java]   at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:598)

  [java]   ... 14 more

  [java] Caused by: org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters
  [java] Original Exception was java.security.InvalidKeyException: Illegal key size or default parameters

  [java]   at org.apache.xml.security.encryption.XMLCipher.encryptData(XMLCipher.java:1140)

  [java]   at org.apache.xml.security.encryption.XMLCipher.encryptData(XMLCipher.java:1081)

  [java]   at org.apache.xml.security.encryption.XMLCipher.encryptElementContent(XMLCipher.java:855)

  [java]   at org.apache.xml.security.encryption.XMLCipher.doFinal(XMLCipher.java:985)

  [java]   at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:602)

  [java]   ... 17 more

  [java] Caused by: java.security.InvalidKeyException: Illegal key size or default parameters

  [java]   at javax.crypto.Cipher.a(DashoA13*..)

  [java]   at javax.crypto.Cipher.a(DashoA13*..)

  [java]   at javax.crypto.Cipher.a(DashoA13*..)

  [java]   at javax.crypto.Cipher.init(DashoA13*..)

  [java]   at javax.crypto.Cipher.init(DashoA13*..)

  [java]   at org.apache.xml.security.encryption.XMLCipher.encryptData(XMLCipher.java:1137)

  [java]   ... 21 more

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}