I'm trying to deploy a simple jax-ws Client as a Bundle to glassfish 4 (i tested 4.0 release and 4.0.1-b04). As osgi runtime i am using Equinox 3.9.1. The Client code Looks like:
final URL wsdlURL = Activator.class
.getResource("/wsdl/Scheduler.wsdl");
if (wsdlURL == null) {
System.err.println("WSDL nicht gefunden - /wsdl/Scheduler.wsdl");
}
final QName qName = new QName("http://xml.novasib.de/tt-sib5",
"Scheduler");
Service service = Service.create(wsdlURL, qName);
Running this code with plain equinox works without Problems. Putting this bundle to domain1\autodeploy\bundles (glassfish running with equinox too) gives the following error:
Caused by: java.lang.Error: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryIm
pl cannot be cast to javax.xml.soap.SAAJMetaFactory
at com.sun.xml.ws.api.SOAPVersion.
at com.sun.xml.ws.api.SOAPVersion.
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:593)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:475)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:249)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:209)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:178)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:363)
at com.sun.xml.ws.client.WSServiceDelegate.
at com.sun.xml.ws.client.WSServiceDelegate.
at com.sun.xml.ws.client.WSServiceDelegate.
at com.sun.xml.ws.client.WSServiceDelegate.
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:114)
at javax.xml.ws.Service.
at de.novasib.xml.tt_sib5.Scheduler_Service.
at hello.osgi.Activator.start(Activator.java:34)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 76 more
Caused by: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast
to javax.xml.soap.SAAJMetaFactory
at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:94)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:142)
at com.sun.xml.ws.api.SOAPVersion.
... 94 more
java.lang.Error: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory
Doing a inspect p c | grep Java.xml.soap gives two bundles which Export this package. The System bundle (org.eclipse.osgi_3.9.1.v20140110-1610) and org.glassfish.metro.webservices-api-osgi_2.3.1.b259.
Running with felix seems to work, although the package is exported twice too (org.apache.felix.framework, org.glassfish.metro.webservices-api-osgi_2.3.1.b259).
The same code works with glassfish 3.x and equinox. The Problem raised when trying to port an existing application to the new glassfish Version.
I will attach the sample project.
Attachment | Size |
---|---|
hello.osgi_.source_1.0.0.201403140944.jar | 1.32 KB |
hello.osgi_1.0.0.201403140944.jar | 6.36 KB |