Red Hat Bugzilla – Bug 780178
java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub executing ESB quickstarts against CXF
Last modified: 2011-02-08 09:46:11 EST
Workaround Description: Remove the jaxws-rt and jaxws-tools jars from soap.esb.
[java] Exception in thread "main" java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy
[java] at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
[java] at org.jboss.test.ws.jaxws.samples.wssecurity.client.WSSClient.setupWsse(WSSClient.java:74)
[java] at org.jboss.test.ws.jaxws.samples.wssecurity.client.WSSClient.getEndpointPort(WSSClient.java:64)
[java] at org.jboss.test.ws.jaxws.samples.wssecurity.client.WSSClient.main(WSSClient.java:50)
This is caused by the existence of the jaxws-rt and tools jars within soap.esb.
Two possible solutions
- remove them as part of the CXF installation
- find an alternative mechanism to pass them in to wise
Link: Added: This issue is related to SOA-2440
Please note that those two jar files contain some important classes like WsImport Ant task needed by some quickstarts.
Only the wise ones, as far as I am aware. Do you know of others?
Link: Added: This issue is duplicated by SOA-2613
Ok, you are right. I did not find any others...
The issue is one of classpath ordering in that the base-build.xml was not updated to include the cxf jars.
Link: Added: This issue depends JBESB-3540
Now that the classpath is fixed it looks like wise no longer uses those files, we may be able to remove them after all.
Spoke too soon, there are explicit loads of "com.sun.xml.ws.spi.ProviderImpl" within the WSDynamicClient so, although it is using the CXF classes to import (once velocity.jar is installed), it is still forcing a load of the sun class.
Will try to disable this using AOP and see if the velocity.jar and AOP is sufficient to get wise working.
Another issue would be the output generated on the console.
11:06:47,541 INFO [STDOUT] Loading FrontEnd jaxws ...
11:06:47,556 INFO [STDOUT] Loading DataBinding jaxb ...
11:06:48,657 INFO [STDOUT] wsdl2java
11:06:48,657 INFO [STDOUT] -compile
11:06:48,657 INFO [STDOUT] -d
11:06:48,658 INFO [STDOUT] /tmp/src/HelloWorldWS
11:06:48,658 INFO [STDOUT] -p
11:06:48,658 INFO [STDOUT] org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise.generated
11:06:48,659 INFO [STDOUT] -verbose
11:06:48,659 INFO [STDOUT] -classdir
11:06:48,659 INFO [STDOUT] /tmp/HelloWorldWS
11:06:48,659 INFO [STDOUT] file:/tmp/Wise8.xml
11:06:48,660 INFO [STDOUT] wsdl2java - Apache CXF 2.2.6-patch-01
I ran the wise tests by copying in the velocity.jar file and leaving the jaxws-rt ones, all worked.
Will assign this to Julian to update the installation script for that jar.
Resolved with revision 7509 of:
Patch CXF installer to copy velocity.jar to .../<profile>/deploy/soap.esb.
Labels: Added: rn-not-needed
Release Notes Docs Status: Added: Not Required
Writer: Added: dlesage