8 Replies Latest reply on Oct 28, 2008 12:19 PM by tomstrummer

    No Classloaders found for ProviderImpl

      I have a default JBossAS 4.2.3 server on which I've installed JBossWS-Metro 3.0.3. I have an EAR which uses a web service client. When I try to invoke the client I get this:

      java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.ws.core.jaxws.spi.ProviderImpl
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:90)
       at javax.xml.ws.spi.Provider.provider(Provider.java:82)
       at javax.xml.ws.Service.<init>(Service.java:81)
       at com.pjm.emkt.emkt.xml.wsdl.MarketQueryService.<init>(MarketQueryService.java:46)
      


      Does this mean JBoss is trying to use the native implementation rather than Metro?

      Thanks.

        • 1. Re: No Classloaders found for ProviderImpl

          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?

          • 2. Re: No Classloaders found for ProviderImpl
            asoldano

            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.

            • 3. Re: No Classloaders found for ProviderImpl

              Alessio --

              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? :)

              Thanks again.

              • 4. Re: No Classloaders found for ProviderImpl
                peterj

                 

                tomstrummer wrote:
                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.

                • 5. Re: No Classloaders found for ProviderImpl
                  peterj

                  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.

                  • 6. Re: No Classloaders found for ProviderImpl

                    Thanks Peter, I'll try that.

                    • 7. Re: No Classloaders found for ProviderImpl

                      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.

                      • 8. Re: No Classloaders found for ProviderImpl

                        Ooh! I changed the JAX-WS and JAXB JARs to "provided" dependencies and it looks like it's working now. Yipee!