I've turned on classloader isolation and added all of the Metro JARs (jaxws-rt and jaxb-impl and api JARs) but JBoss is still trying to look for the jbossws-client JAR. Any ideas?
First of all make sure you installed jbossws-metro properly using the provided Ant build.
This said, the Provider implementation you get at runtime is influenced by classpath you have for your webservice client. In particular, the process of looking for the right implementation to load includes scanning the jars in the classpath for META-INF/services/javax.xml.ws.spi.Provider files containing the qualified name of the class to load. In your case, you might have the jbossws-native-jaxws.jar before the jaxws-rt.jar in your classpath.
Thanks for getting back to me. I'm sure I don't have the JBossws JARs in my EAR (that's why it can't find ProviderImpl).
I'll search my classpath to see where that javax.xml.ws.spi.Provider is being looked up from. I'm afraid JBossWS-native might still be installed in the server classpath even though I did install jbossws-metro using the Ant build.
I'll see if I can't track that down. Is there any way to "query" the classpath for a given resource to find out what JAR it's coming from? :)
Is there any way to "query" the classpath for a given resource to find out what JAR it's coming from?
I use a tool name JarFinder from http://www.isocra.com/2006/02/jarfinder/. It has saved my sanity countless times.
I read your post again and think that maybe what you are looking for is the "-verbose:class" option to the JVM. This causes the JVM to print out each class file loaded and the location of the jar file from which the class was obtained.
Thanks Peter, I'll try that.
That definitely helped me find my problem. Apparently the JBossWS-native libs were still in jboss-4-2-3.GA/lib/endorsed. I removed all of the jaxws_.jars from that directory and it got me a little futher at least.
Then I battled my way through the forests of XML API versioning until I came to face a new beast when invoking the WS client:
com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider com.sun.xml.ws.policy.jaxws.client.PolicyServiceInterceptorFactory is specified in jar:file:/home/tnichols/dev/sandbox/jboss-4.2.3.GA-metro/server/default/deploy/jbossws.sar/jbossws-metro-wsit-rt.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut could not be instantiated: java.lang.ClassCastException (com.sun.xml.ws.util.ServiceConfigurationError) com.sun.xml.ws.util.ServiceFinder:233 (null) java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:374) at com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:80) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:202) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:175) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104) at javax.xml.ws.Service.<init>(Service.java:56) at com.pjm.emkt.emkt.xml.wsdl.MarketQueryService.<init>(MarketQueryService.java:46)
I'm using the jbossws-metro v3.0.4 (installed on the server) along with jaxws-api-2.1 and jaxws-rt-2.1.4 from Maven in my EAR classpath.
Thanks again for the help.
Ooh! I changed the JAX-WS and JAXB JARs to "provided" dependencies and it looks like it's working now. Yipee!