1 year ago

#348262

test-img

Christian Meister

unable to Load Class com.sun.xml.ws.api.SOAPVersion when deploying Application to Glassfish4

Our Web-Application runs fine on Glassfish 3 and we want to migrate to Glassfish 4 and beyond.

When i deploy the war file to Glassfish 4 i get the following Exception:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class 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:364)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:322)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:231)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:212)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:208)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:119)
at javax.xml.ws.Service.<init>(Service.java:92)

On Glassfish 3 there is no implementation of JaxWS and the default Implementation of the Java Runtime is used.

javax.xml.ws.Service
com.sun.xml.internal.ws.client.WSServiceDelegate
com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser

On Glassfish 4 there are two jarfiles who replace/overwrite this functionality.

webservices-api-osgi.jar and
webservices-osgi.jar

webservices-api-osgi.jar contains the new Service class javax.xml.Service which then uses the classes com.sun.xml.ws.* as shown in the exception.

What i don't understand is why the class com.sun.xml.ws.api.SOAPVersion is not found it exist in webservices-osgi.jar just like com.sun.xml.ws.client.WSServiceDelegate and com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.

Both Glassfish3 and Glassfish4 run on Oracle Java8 JDK.

java

glassfish

jax-ws

0 Answers

Your Answer

Accepted video resources