Something has changed in the classloading between Java 6 and Java 8 which leads to the following stack trace when:
attempting to use the proxy method of initializing the connection to a JAX-WS web service, which dynamically creates the stub on the client side using the WSDL hosted on the server side, and
running Java 8 as an embedded JVM from within a Windows process.
The code in ClientContainer.java does not seem to handle the scenario with both of its attempts to resolve a classloader result in the bootstrap classloader being returned. Thus the result is a NullPointerException on line 45.
The stack trace is as follows:
java.lang.NullPointerException
at com.sun.xml.internal.ws.client.ClientContainer$1.getResource(Unknown Source)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.locateResource(Unknown Source)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.locateResource(Unknown Source)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.init(Unknown Source)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.<init>(Unknown Source)
at com.sun.xml.internal.ws.assembler.TubelineAssemblyController.getTubeCreators(Unknown Source)
at com.sun.xml.internal.ws.assembler.MetroTubelineAssembler.createClient(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.createPipeline(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getStubHandler(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at javax.xml.ws.Service.getPort(Unknown Source)
at myclient.stub.MyService.<init>(MyService.java:38)
Something has changed in the classloading between Java 6 and Java 8 which leads to the following stack trace when:
The code in ClientContainer.java does not seem to handle the scenario with both of its attempts to resolve a classloader result in the bootstrap classloader being returned. Thus the result is a NullPointerException on line 45.
The stack trace is as follows:
This problem is documented at StackOverflow: http://stackoverflow.com/questions/32720458/jaxws-webservice-client-for-java-6-not-working-in-java-8
A workaround for the problem is also provided at http://stackoverflow.com/questions/32720458/jaxws-webservice-client-for-java-6-not-working-in-java-8/33305743#33305743
Affected Versions
[2.2.8, 2.2.10]
Source: https://github.com/javaee/metro-jax-ws/issues/1178 Author: glassfishrobot