You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Beyer, Doug" <do...@troppussoftware.com> on 2011/10/02 20:28:22 UTC

ClassNotFound exception with web service consumer in osgi

I've downloaded the Apache CXF sample from http://logicsector.wordpress.com/2008/10/19/how-to-create-a-wsdl-first-soap-client-in-java-with-cxf-and-maven/. It built and ran fine using the standalone jar it creates.

I took the guts of the code from that sample and created an osgi bundle (not using maven).  The structure of the bundle is:

>> Begin manifest.mf

Root
                Com
                                Beyer
                                                Impl
                                                                Activator
                                Cdyne
                                                <web service consumer files generated by Apache CXF>
                Lib
                                axis2-jaxws-1.4.1.jar
                                jaxws-api-2.1-1.jar
                                jaxws-rt-2.1.4.jar
                                cxf-2.4.2.jar
                                neethi-3.0.1.jar
                                wsdl4j-1.6.2.jar
                                xmlschema-core-2.0.jar
                META-INF
                                MANIFEST.MF
Cxf.xml

>> End manifest.mf

I've attached my manifest.xml file and my activator file.

I get the following error when starting my bundle in Felix:

Beyer Weather Service starting...
Beyer Weather Service started.
Exception in thread "WeatherThread" g! javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found
        at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:38)
        at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:133)
        at javax.xml.ws.spi.Provider.provider(Provider.java:83)
        at javax.xml.ws.Service.<init>(Service.java:56)
        at com.cdyne.ws.weatherws.Weather.<init>(Weather.java:55)
        at com.beyer.impl.Activator$2.run(Activator.java:252)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.spi.ProviderImpl
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:34)
        ... 6 more

But ProviderImpl is in the jaxws-rt-2.1.4.jar which is in the Bundle-Classpath manifest header.

Does anyone know why I'm getting this exception?