Hi all,

When running the $subject sample [1] I have encountered the following error.

  [java] 13/12/20 10:02:23 ERROR sandesha2.SandeshaModule: Could not load
module policies. Using default values.
     [java] 13/12/20 10:02:23 INFO mail.MailTransportSender: MAILTO Sender
started
     [java] 13/12/20 10:02:23 INFO jms.JMSSender: JMS Sender started
     [java] 13/12/20 10:02:23 INFO jms.JMSSender: JMS Transport Sender
initialized...
     [java] Using WS-Security
     [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: An
unsupported signature or encryption algorithm was used (unsupported key
transport encryption algorithm: No such algorithm:
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p); nested exception is:
     [java]     java.security.NoSuchAlgorithmException: Cannot find any
provider supporting RSA/ECB/OAEPPadding
     [java]     at
org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:785)
     [java]     at
org.apache.ws.security.message.WSSecEncryptedKey.prepareInternal(WSSecEncryptedKey.java:205)
     [java]     at
org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:259)
     [java]     at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:578)
     [java]     ... 14 more
     [java] Caused by: java.security.NoSuchAlgorithmException: Cannot find
any provider supporting RSA/ECB/OAEPPadding
     [java]     at javax.crypto.Cipher.getInstance(DashoA13*..)
     [java]     at
org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:777)
     [java]     ... 17 more


However I tried to fix the issue I found that after,

1. copying the bcprov-jdk15.jar jar file to the <JAVA_HOME>/jre/lib/ext
2. Adding the following to the
<ESB_HOME>/samples/axis2Client/src/samples/userguide/StockQuoteClient.java
file

import java.security.Security;
import org.bouncycastle.jce.provider.BouncyCastleProvider;

        // in main method
        if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) ==
null) {
            Security.addProvider(new BouncyCastleProvider());
        }


I followed the steps mentioned in here [2] overcome the problem.  After
that example worked fine. My JDK version is java version "1.6.0_45".

Don't we have to mention this in the example documentation also? WDYT?


[1].
http://docs.wso2.org/display/ESB480/Sample+200%3A+Using+WS-Security+with+policy+attachments+for+proxy+services
[2]. http://stackoverflow.com/a/17318843
-- 

*Aruna Sujith Karunarathna* | Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: [email protected] | Web: www.wso2.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to