Hi,
Just a quick notes, embed 3rd party jars in your bundle isn't a good
practice in OSGi world, you should always try to install all necessary
3rd party bundles/jars in OSGi container and from your bundle you
should import necessary package, this is the expected behavior in OSGi
container.
Freeman
On 2011-9-24, at 上午9:00, Shamik Bandopadhyay wrote:
Hi,
I'm having an exception during deployment of a bundle. The bundle
makes a
web service call from one its class. The introduction of the web
service is
causing the issue. Here's the error :
Caused by: 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)
at
javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:124)
at javax.xml.ws.spi.FactoryFinder.access
$200(FactoryFinder.java:44)
at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:211)
at
javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:220)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:160)
at javax.xml.ws.spi.Provider.provider(Provider.java:43)
at javax.xml.ws.Service.<init>(Service.java:35)
I've similar bundles which is using the similar web service clients
without
any issues. The only difference in this bundle is the addition of few
embedded jar files. Here's a snippet of my pom.
<dependency>
<groupId>org.apache.servicemix.specs</groupId>
<artifactId>org.apache.servicemix.specs.jsr311-api-1.0</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.specs</groupId>
<artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.commons-httpclient</
artifactId>
</dependency>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
javax.jws,
javax.wsdl,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.namespace,
javax.xml.ws,
META-INF.cxf,
META-INF.cxf.osgi,
org.apache.cxf.bus,
org.apache.cxf.bus.spring,
org.apache.cxf.bus.resource,
org.apache.cxf.configuration.spring,
org.apache.cxf.resource,
org.apache.cxf.jaxws,
org.apache.cxf.transport.http,
!org.jvnet.staxex,
!org.relaxng.datatype,
!com.sun.javadoc,
!com.caucho.burlap.*,
*;resolution:=optional
</Import-Package>
<Embed-Dependency>commons-io,commons-lang,commons-chain,commons-
jxpath,commons-httpclient,jericho-html,velocityclient,heritrix-
commons,guava,fastutil;scope=compile|runtime</Embed-Dependency>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
<Include-Resource>
{maven-resources}, {maven-dependencies}
</Include-Resource>
</instructions>
</configuration>
</plugin>
The difference with the other bundles are the additional jars in the
form of
heritrix-commons,guava,fastutil inside embed-dependency.
A while back I had faced similar exception which got resolved by
adding the
import statements.
I even tried adding cxf-bundle jar inside embed-dependency, but that
started
to throw Spring Class cast exception.
I'll appreciate if you can provide a pointer.
- Thanks
---------------------------------------------
Freeman Fang
FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com