JBAS 4.2.3-JDK6, Mule, JAX-WS classloading trouble
rspielmann Dec 26, 2009 12:59 PMHi all,
I'm facing the following infrastructure:
- JBoss 4.2.3 JDK6 package
- JDK 1.6.0_12
- An application that contains Mule 2.2.1 with the CXF transport 2.2.1
The application is deployed as a WAR into a copy of the "default" configuration.
First problem is that I get a ClassCastException about org.apache.cxf.jaxws.ServiceImpl not being castable to javax.xml.ws.spi.ServiceDelegate21. After some research, I found out that the jboss-jaxws* JARs deliver a JAXWS 2.0 implementation, whereas the application needs a JAXWS 2.1 implementation.
Next step was to configure classloading for the WAR. I created a jboss-web.xml and set java2ClassLoadingCompliance to "true". This helps a little, the ClassCastException is gone. But what I get now is this:
WSDLException: faultCode=INVALID_WSDL: Document style message parts must define an element name: {http://somehost/whatever.wsdl}Request (javax.wsdl.WSDLException) org.jboss.ws.tools.wsdl.WSDL11Reader:964 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/wsdl/WSDLException.html
I tried to fix the WSDL which was not quite successful because it contains soap12 stuff which I couldn't simply replace. I was a little unsure about why WSDL11Reader would be used here, so I debugged the loaded classes and found out that I'm still getting the javax.xml.ws classes like Service, Provider etc. from the JBoss JARs. I tried using a META-INF/services/javax.xml.ws.spi.provider file that contains "org.apache.cxf.jaxws.spi.ProviderImpl" as its only line, but obviously this file is not read but instead the default file from a JBoss JAR is used when the Provider is loaded. Thus, I'm still getting classes from the JBoss JAXWS implementation, and so I'm running into trouble again.
The application brings quite a lot of libraries, e.g. jaxws-api-2.1-1-osgi.jar, and it ran just fine on JBoss 4.0.4. If I delete the jboss-jaxws* JARs from $JBOSS_HOME/lib/endorsed, I can also run the application just fine, even without tuning the classloading options.
I'm a little unsure what to do now - I see a couple of options:
- Use the regular JBoss 4.2.3 package instead of JBoss 4.2.3-jdk6
- Use a scoped classloader repository which I tried but didn't quite get to work
- What else could I do?
I don't think that it will be possible to rewrite the entire collection of services in order to become JAXWS-compliant
Any hints?