Couple thoughts:

1) Make sure you are using the LATEST (1.9.0) version of the servicemix 
specs jaxws-api 2.2 bundle.  The older versions relied on some of the 
geronimo-specs locator things that we found didn't work as well.

2) Update to CXF 2.5.3 if possible (or even 2.6.0), there were a bunch of 
issues with using the "pure jaxws API's" that were fixed related to setting 
the Thread context classloader.   Parts of the JAX-WS API's need the thread 
context classloader set.

3)  Wrap your call to Service.create with something like:

Thread.setContextClassloader(Bus.class.getClassloader());

or similar to make sure the thread context classloader that the JAX-WS SPI 
would look at contains the CXF stuff.  



Dan




On Tuesday, May 08, 2012 02:19:33 PM jevans12 wrote:
> Hello,
> 
> Im trying to use the Dispatch API from cxf v2.4.1 in Karaf v2.2. java v1.6
> and Spring-DM for DI.
> Running my unit test in eclipse is successful. When i deploy over to OSGI
> I get a ProviderImpl.class not found.
> 
> The weird thing i see in the stacktrace is that the Factory class is
> coming out of the JRE, even though karaf is config'd NOT to export
> javax.xml.ws.spi.* classes and karaf is telling me that its importing them
> from
> avax.xml.ws.spi,version=2.2.0 from
> org.apache.servicemix.specs.jaxws-api-2.2 (80)
> 
> 
> Code snip
> ---------------
> try {
> 
>                       URL wsdlURL = new URL(url + "?wsdl");
>                       Service service = Service.create(wsdlURL, _SERVICE);
>                       remoteService = service.createDispatch(_PORT, 
> Source.class,
>                                       Service.Mode.PAYLOAD);
> 
> }
> 
> Pom.xml snip
> ----------------
> <dependency>
>                       <groupId>org.apache.cxf</groupId>
>                       <artifactId>cxf-bundle</artifactId>
>                       <version>${cxf.version}</version>  <-- v2.4.1
>               </dependency>
> 
>       <Import-Package>
> 
>                                                       javax.jws, 
> javax.jws.soap,
>                                                       javax.security.auth, 
> javax.xml.bind,
>                                                       
> javax.xml.bind.annotation,
>                                                       
> javax.xml.bind.annotation.adapters,
>                                                       javax.xml.datatype,
>                                                       javax.xml.parsers,
>                                                       javax.xml.transform,
>                                                       javax.xml.namespace,
>                                                       javax.xml.transform.dom,
>                                                       
> javax.xml.transform.stream,
>                                                       javax.xml.ws,
>                                                       javax.xml.ws.spi,
>                                                       
> javax.xml.xpath,javax.net.ssl,
>                                                       net.sf.saxon,
>                                                       org.apache.commons.io,
>                                                       org.apache.cxf.jaxws, 
*org.apache.cxf.jaxws.spi,*
>                                                       
> org.apache.log4j,org.slf4j,
>                                                       org.slf4j.ext, 
> org.w3c.dom, 
us.gov.ic.ism.v2,
>                                                       
> org.apache.cxf.bus.spring,
>                                                       org.xml.sax
> 
>                                               </Import-Package>
> 
> Felix WebConsole
> -----------------
> Imported Packages META-INF.cxf,version=0.0.0 from org.apache.cxf.bundle
> (107)
> META-INF.cxf.osgi,version=0.0.0 from org.apache.cxf.bundle (107)
> *javax.jws,version=2.0.0 from
> org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec (77)
> javax.jws.soap,version=2.0.0 from
> org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec (77)*
> javax.net.ssl,version=0.0.0 from org.eclipse.osgi (0)
> javax.security.auth,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.bind,version=2.2.1 from org.apache.servicemix.specs.jaxb-api-2.2
> (79)
> javax.xml.bind.annotation,version=2.2.1 from
> org.apache.servicemix.specs.jaxb-api-2.2 (79)
> javax.xml.bind.annotation.adapters,version=2.2.1 from
> org.apache.servicemix.specs.jaxb-api-2.2 (79)
> javax.xml.datatype,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.namespace,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.parsers,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.transform,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.transform.dom,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.transform.stream,version=0.0.0 from org.eclipse.osgi (0)
> javax.xml.ws,version=2.2.0 from org.apache.servicemix.specs.jaxws-api-2.2
> (80)
> *javax.xml.ws.spi,version=2.2.0 from
> org.apache.servicemix.specs.jaxws-api-2.2 (80)*
> javax.xml.xpath,version=0.0.0 from org.eclipse.osgi (0)
> *org.apache.cxf.jaxws.spi,version=2.4.1 from org.apache.cxf.bundle (107)*
> 
> 
> 
> Exception
> --------------
> 
> 16:09:28,113 | ERROR | s.x) | xxxx              171 | xxx    | Encounted
> exception
> 
> : Provider org.apache.cxf.jaxws.spi.ProviderImpl not found
> 
> javax.xml.ws.spi.FactoryFinder$ConfigurationError:* Provider
> org.apache.cxf.jaxws.spi.ProviderImpl not found
>         at javax.xml.ws.spi.FactoryFinder$2.run(FactoryFinder.java:130)*
>        * at
> javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:220)[:1.6.0
> _25]* at
> javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:124)[:1.6.0_
> 25] at
> javax.xml.ws.spi.FactoryFinder.access$200(FactoryFinder.java:44)[:1.6.0_25
> ] at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:211) at
> javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:220)[:1.6.0
> _25] at
> javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:160)[:1.6.0_25]
>         at javax.xml.ws.spi.Provider.provider(Provider.java:43)[:1.6.0_25]
> at javax.xml.ws.Service.<init>(Service.java:35)[:1.6.0_25] at
> javax.xml.ws.Service.create(Service.java:122)[:1.6.0_25] at
> ddf.site.cedes.CEDESSoapSite.setServiceUrl(CEDESSoapSite.java:158)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.6.0_25]
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)[:1.6.0_25] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:25)[:1.6.0_25] at
> java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_25] at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl
> .java:1114)[41:org.springframework.beans:3.0.5.RELEASE] at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl
> .java:880)[41:org.springframework.beans:3.0.5.RELEASE] at
> org.springframework.osgi.compendium.internal.cm.CMUtils.applyMapOntoInstan
> ce(CMUtils.java:56)[47:org.springframework.osgi.core:1.2.1] at
> org.springframework.osgi.compendium.internal.cm.ManagedServiceFactoryFacto
> ryBean$InitialInjectionProcessor.postProcessBeforeInitialization(ManagedSe
> rviceFactoryFactoryB an.java:107)[47:org.springframework.osgi.core:1.2.1]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto
> ry.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBean
> Factory.java:394)[41 org.springframework.beans:3.0.5.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto
> ry.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)[41:org.spr
> ingframework.beans:3 0.5.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto
> ry.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[41:org.spring
> framework.beans:3.0. .RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto
> ry.createBean(AbstractAutowireCapableBeanFactory.java:456)[41:org.springfr
> amework.beans:3.0.5. ELEASE]
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Dispatch-API-use-in-OSGI-ProviderImpl-not
> -Found-tp5695942.html Sent from the cxf-user mailing list archive at
> Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to