2

What do I have to do to call Endpoint.publish from a bundle in servicemix?

I have used wsdl2java to create an impl that I launch inside a BundleActivator:

LOG.info("WSBundle registering using endpoint...");
endpointAddress = substituteParameters(endpointAddress, ref);
Endpoint endpoint = Endpoint.publish(endpointAddress, service);
myEndpoints.put(service, endpoint);
LOG.info("WSBundle registered server at: "+endpointAddress);

This works fine inside the Eclipse IDE but fails when I run the bundle inside the service mix deploy area. At first the failure was due to missing some classes in the following packages:

javax.xml.ws,
javax.xml.ws.spi,
org.apache.cxf.endpoint,
org.apache.cxf.frontend,
org.apache.cxf.jaxws,
org.apache.cxf.jaxws.spi,

After adding these to my manifest as imported packages I get the following error:

ERROR: Bundle WSExposer [187] EventDispatcher: Error during dispatch. (javax.xml.ws.spi.FactoryFinder$ConfigurationError: 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:133)
    at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:238)
    at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:127)
    at javax.xml.ws.spi.FactoryFinder.access$200(FactoryFinder.java:44)
    at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:229)
    at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:238)
    at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:163)
    at javax.xml.ws.spi.Provider.provider(Provider.java:43)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:57)

My manifest file is as follows:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WSBundle
Bundle-SymbolicName: WSBundle
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.company.soa.wsbundle.WSExposerActivator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.company.product.history.filtertypes.v1,
com.company.product.system.basetypes.v1,
com.company.svc.product.event.v1,
com.company.svc.product.service.event.v1,
com.company.svc.product.service.faults.v1,
javax.xml.ws,
javax.xml.ws.spi,
org.apache.cxf.endpoint,
org.apache.cxf.frontend,
org.apache.cxf.jaxws,
org.apache.cxf.jaxws.spi,
org.osgi.framework
Export-Package: com.company.soa.wsbundle
рüффп
  • 5,172
  • 34
  • 67
  • 113
hexa
  • 41
  • 5

1 Answers1

0

I found that you can switch service mix to use the Equinox frame work which resolved the issue. in the etc/config.properties change the karaf.framework to eclipse: karaf.framework=equinox

hexa
  • 41
  • 5