Hello all,
I have an OSGI based application that needs to do some web-services to
interact with other pieces of software. For this, we use the
javax.xml.wsstuff. The implementation we use is Apache CXF.
My problem is that the javax.xml.ws stuff seems to be one of those
"configure myself magically and produce epic fail on OSGI" things. So to get
a web-services endpoint we do this
endpoint = Endpoint.publish(address, implementor);
This works if I run a standard Java application and put CXF jars in the
classpath. It also works if I create an OSGI bundle and put all the CXF jars
inside this bundle and in the bundle classpath.
It fails if I put the CXF libs in their own bundle and try to export/import
the javax.xml.ws package where the Endpoint class is. Maybe it uses the
classloader to register itself when loaded and because the bundles are using
a different classloader it fails?
Part of the stacktrace showing that it defaults to using the JDK internal
implementation that does not work in our environment:
at
com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(Unknown
Source)
at
com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(Unknown
Source)
at javax.xml.ws.Endpoint.publish(Unknown Source)
Any ideas for how do I fix this? So far I have it working by putting all
CXF jars inside all my bundles that use it (~10MB, some 20+jars, inside each
bundle, whoppee) but would rather not duplicate them.
Thanks,
Teemu