Bug 780178 (SOA-2553)

Summary: java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub executing ESB quickstarts against CXF
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Kevin Conner <kevin.conner>
Component: JBossESBAssignee: Julian Coleman <jcoleman>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.1.0.ER3CC: kevin.conner
Target Milestone: ---   
Target Release: 5.1.0 GA, 5.1.0.ER5   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2553
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-08 14:46:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kevin Conner 2010-11-08 13:42:15 UTC
Workaround Description: Remove the jaxws-rt and jaxws-tools jars from soap.esb.
project_key: SOA

[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

Comment 1 Kevin Conner 2010-11-08 13:42:34 UTC
Link: Added: This issue is related to SOA-2440


Comment 2 Martin Vecera 2010-12-01 14:29:52 UTC
Please note that those two jar files contain some important classes like WsImport Ant task needed by some quickstarts.

Comment 3 Kevin Conner 2010-12-01 14:43:34 UTC
Only the wise ones, as far as I am aware.  Do you know of others?

Comment 4 Kevin Conner 2010-12-01 18:05:03 UTC
Link: Added: This issue is duplicated by SOA-2613


Comment 5 Martin Vecera 2010-12-02 09:44:55 UTC
Ok, you are right. I did not find any others...

Comment 6 Kevin Conner 2010-12-03 10:18:13 UTC
The issue is one of classpath ordering in that the base-build.xml was not updated to include the cxf jars.

Comment 7 Kevin Conner 2010-12-03 10:22:38 UTC
Link: Added: This issue depends JBESB-3540


Comment 8 Kevin Conner 2010-12-03 10:29:58 UTC
Now that the classpath is fixed it looks like wise no longer uses those files, we may be able to remove them after all.

Comment 9 Kevin Conner 2010-12-03 11:20:40 UTC
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.

Comment 10 Kevin Conner 2010-12-03 11:22:22 UTC
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


Comment 11 Kevin Conner 2010-12-03 12:08:32 UTC
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.

Comment 12 Julian Coleman 2010-12-03 15:47:01 UTC
Resolved with revision 7509 of:

  build-tools/builders/eap/post-patch/patch_cxf_installer_macros.xml
  build-tools/builders/eap/resource/patch_macros.xsl

Commit message:

  SOA-2553
  Patch CXF installer to copy velocity.jar to .../<profile>/deploy/soap.esb.


Comment 13 Julian Coleman 2010-12-03 15:47:01 UTC
Labels: Added: rn-not-needed


Comment 14 Laura Bailey 2010-12-17 01:00:57 UTC
Release Notes Docs Status: Added: Not Required


Comment 16 Dana Mison 2011-01-05 00:14:33 UTC
Writer: Added: dlesage