Hi,

This ClassCastException comes from that org.apache.ws.security.action.UsernameTokenAction and org.apache.ws.security.action.Action are loaded from different classloaders. One is from WSS4J bundle installed in OSGi container, the other one is from wss4j jar in your SA as you're using old JBI bundle now.

The solution is
add
<classpath>
  <library>osgi:org.apache.ws.security.wss4j</library>
</classpath>
in ./wsdl-first-cxfbc-su/src/main/resources/xbean.xml, this enable your SU refer a class from a installed bundle inside the OSGi container, more details take a look at [1], "New in Servicemix 4.2.0"
Also you need edit ./wsdl-first-cxfbc-su/pom.xml
add
<scope>provided</scope>
for the wss4j dependency.

Btw, I encourage you use OSGi packaging but not old JBI packaging as now you're working with a OSGi container, with OSGi packaging you needn't package 3rd libs into your own SA, all are shared from the bundles installed in the container.

[1]http://servicemix.apache.org/classloaders.html

Freeman
On 2011-4-12, at 下午4:31, pchakinala wrote:

Hi Freeman,
Here enclosed request xml which had sent from http client.


                anna



Error in servicemix log:
13:52:22,437 | DEBUG | rovider-thread-1 | Init | 102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 | Now I try to bind xx
to http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 | XX_init
172 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |   XX_prng
0 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |   XX_parsing
0 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init | 102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 | XX_configure_i18n
62 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_c14n             15 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_jcemapper        0 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_keyInfo          16 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_keyResolver      16 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_prefixes         0 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_resourceresolver 0 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_sigalgos         16 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Init |
102 - org.apache.servicemix.bundles.xmlsec - 1.4.3.3 |
XX_configure_reg_transforms       47 ms
13:52:22,437 | DEBUG | rovider-thread-1 | Loader |
113 - org.apache.ws.security.wss4j - 1.5.9 |
org.bouncycastle.jce.provider.BouncyCastleProvider in classloader
org .apache.xbean.spring.context.FileSystemXmlApplicationContext@12467d8
java.lang.ClassNotFoundException:
org.bouncycastle.jce.provider.BouncyCastleProvider in classloader
org .apache.xbean.spring.context.FileSystemXmlApplicationContext@12467d8
        at
org .apache .xbean .classloader .MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206) [140:org.apache.xbean.classloader:3.7]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_24]
        at
org.apache.ws.security.util.Loader.loadClass(Loader.java:185) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.loadProvider(WSSConfig.java:578) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.addJceProvider(WSSConfig.java:635) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:293) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.(WSSConfig.java:312) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:321) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 173)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 134)[116:org.apache.cxf.bundle:2.3.2]
        at
org .apache .cxf .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 255)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java: 247)[156:servicemix-cxf-bc:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651) [121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 606)[121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501) [121:servicemix-common:2011.01.0]
        at
org.apache.servicemix.common.AsyncBaseLifeCycle $2.run(AsyncBaseLifeCycle.java:370)[121:servicemix-common:2011.01.0]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
        at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
13:52:22,437 | DEBUG | rovider-thread-1 | WSSConfig | 113 - org.apache.ws.security.wss4j - 1.5.9 | The provider BC could not be
added: org.bouncycastle.jce.provider.BouncyCastleProvider not found by
org.apache.ws.security.wss4j [113]
13:52:22,437 | DEBUG | rovider-thread-1 | Loader |
113 - org.apache.ws.security.wss4j - 1.5.9 |
org.apache.security.juice.provider.JuiCEProviderOpenSSL in classloader
org .apache.xbean.spring.context.FileSystemXmlApplicationContext@12467d8
java.lang.ClassNotFoundException:
org.apache.security.juice.provider.JuiCEProviderOpenSSL in classloader
org .apache.xbean.spring.context.FileSystemXmlApplicationContext@12467d8
        at
org .apache .xbean .classloader .MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206) [140:org.apache.xbean.classloader:3.7]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_24]
        at
org.apache.ws.security.util.Loader.loadClass(Loader.java:185) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.loadProvider(WSSConfig.java:578) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.addJceProvider(WSSConfig.java:635) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:294) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.(WSSConfig.java:312) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:321) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 173)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 134)[116:org.apache.cxf.bundle:2.3.2]
        at
org .apache .cxf .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 255)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java: 247)[156:servicemix-cxf-bc:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651) [121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 606)[121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501) [121:servicemix-common:2011.01.0]
        at
org.apache.servicemix.common.AsyncBaseLifeCycle $2.run(AsyncBaseLifeCycle.java:370)[121:servicemix-common:2011.01.0]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
        at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
13:52:22,437 | DEBUG | rovider-thread-1 | WSSConfig | 113 - org.apache.ws.security.wss4j - 1.5.9 | The provider JuiCE could not be added: org.apache.security.juice.provider.JuiCEProviderOpenSSL not found by
org.apache.ws.security.wss4j [113]
13:52:22,484 | DEBUG | rovider-thread-1 | WSS4JOutInterceptor |
-  -  | Action: 1
13:52:22,484 | DEBUG | rovider-thread-1 | WSS4JOutInterceptor |
-  -  | Actor: null
13:52:22,484 | DEBUG | rovider-thread-1 | WSHandler |
113 - org.apache.ws.security.wss4j - 1.5.9 | Performing Action: 1
13:52:22,484 | DEBUG | rovider-thread-1 | WSSConfig |
113 - org.apache.ws.security.wss4j - 1.5.9 |
org.apache.ws.security.action.UsernameTokenAction cannot be cast to
org.apache.ws.security.action.Action
java.lang.ClassCastException:
org.apache.ws.security.action.UsernameTokenAction cannot be cast to
org.apache.ws.security.action.Action
        at
org.apache.ws.security.WSSConfig.getAction(WSSConfig.java:505) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org .apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java: 205)[113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access $200(WSS4JOutInterceptor.java:50)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 257)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 134)[116:org.apache.cxf.bundle:2.3.2]
        at
org .apache .cxf .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 255)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java: 247)[156:servicemix-cxf-bc:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651) [121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 606)[121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501) [121:servicemix-common:2011.01.0]
        at
org.apache.servicemix.common.AsyncBaseLifeCycle $2.run(AsyncBaseLifeCycle.java:370)[121:servicemix-common:2011.01.0]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
        at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal@1b8757 13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor@71a9f3
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@cdc69b
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor@d17274
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.interceptor.StaxOutInterceptor@1aa2b26
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.servicemix.cxfbc.interceptors.JbiOutInterceptor@1b2725a
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org .apache .cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor@4c98f4 13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.ws.policy.ServerPolicyOutFaultInterceptor@7ac7c5
13:52:22,500 | DEBUG | rovider-thread-1 | PhaseInterceptorChain |
-  -  | Invoking handleFault on interceptor
org.apache.cxf.ws.policy.PolicyOutInterceptor@f7092a
13:52:22,500 | WARN | rovider-thread-1 | PhaseInterceptorChain | - - | Interceptor for {http://order.demo/}OrderProcessImplService has
thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Security processing failed.
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 272)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 134)[116:org.apache.cxf.bundle:2.3.2]
        at
org .apache .cxf .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 255)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java: 247)[156:servicemix-cxf-bc:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651) [121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 606)[121:servicemix-common:2011.01.0]
        at
org .apache .servicemix .common .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501) [121:servicemix-common:2011.01.0]
        at
org.apache.servicemix.common.AsyncBaseLifeCycle $2.run(AsyncBaseLifeCycle.java:370)[121:servicemix-common:2011.01.0]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
        at
java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
        at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
Caused by: org.apache.ws.security.WSSecurityException: General security
error (Unable to load class
org.apache.ws.security.action.UsernameTokenAction); nested exception is:
        java.lang.ClassCastException:
org.apache.ws.security.action.UsernameTokenAction cannot be cast to
org.apache.ws.security.action.Action
        at
org.apache.ws.security.WSSConfig.getAction(WSSConfig.java:510) [113:org.apache.ws.security.wss4j:1.5.9]
        at
org .apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java: 205)[113:org.apache.ws.security.wss4j:1.5.9]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access $200(WSS4JOutInterceptor.java:50)[116:org.apache.cxf.bundle:2.3.2]
        at
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor $WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java: 257)[116:org.apache.cxf.bundle:2.3.2]
        ... 10 more
Caused by: java.lang.ClassCastException:
org.apache.ws.security.action.UsernameTokenAction cannot be cast to
org.apache.ws.security.action.Action
        at
org.apache.ws.security.WSSConfig.getAction(WSSConfig.java:505) [113:org.apache.ws.security.wss4j:1.5.9]
        ... 13 more

Regards,
Praveen Chakinala

--
View this message in context: 
http://servicemix.396122.n5.nabble.com/cxfbc-java-lang-ClassNotFoundException-org-apache-security-juice-provider-JuiCEProviderOpenSSL-tp4290867p4297734.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference








Reply via email to