Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Current Neon version seems to prevent JDKs JAX-WS implementation from working
Current Neon version seems to prevent JDKs JAX-WS implementation from working [message #1733468] Fri, 27 May 2016 21:05 Go to next message
Max Bureck is currently offline Max BureckFriend
Messages: 19
Registered: April 2013
Junior Member
I am not entirely sure this is an error in Equinox, but there is no indication this might be an platform problem. I am trying to start a JAX-WS web service in an Eclipse Neon bundle, but I get an exception:

java.lang.Error: Failed to create new instance of com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory$1
	at com.sun.xml.internal.ws.api.streaming.ContextClassloaderLocal.createNewInstance(ContextClassloaderLocal.java:63)
	at com.sun.xml.internal.ws.api.streaming.ContextClassloaderLocal.get(ContextClassloaderLocal.java:47)
	at com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.get(XMLStreamWriterFactory.java:175)
	at com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.create(XMLStreamWriterFactory.java:199)
	at com.sun.xml.internal.ws.server.SDDocumentImpl.writeTo(SDDocumentImpl.java:271)
	at com.sun.xml.internal.ws.transport.http.HttpAdapter.publishWSDL(HttpAdapter.java:769)
	at com.sun.xml.internal.ws.transport.http.HttpAdapter.handleGet(HttpAdapter.java:278)
	at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:251)
	at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:98)
	at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.access$000(WSHttpHandler.java:47)
	at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler$HttpHandlerRunnable.run(WSHttpHandler.java:122)
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
	at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
	at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
	at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
	at javax.xml.stream.FactoryFinder$1.run(FactoryFinder.java:352)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.xml.stream.FactoryFinder.findServiceProvider(FactoryFinder.java:341)
	at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:313)
	at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:227)
	at javax.xml.stream.XMLOutputFactory.newInstance(XMLOutputFactory.java:130)
	at com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory$1.initialValue(XMLStreamWriterFactory.java:79)
	at com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory$1.initialValue(XMLStreamWriterFactory.java:66)
	at com.sun.xml.internal.ws.api.streaming.ContextClassloaderLocal.createNewInstance(ContextClassloaderLocal.java:61)
	... 15 more


The same code works fine in Mars and Luna.
I wrote a minimal example as a plugin test. Here is the service interface;

package jaxws.example;

import javax.jws.WebService;

@WebService(serviceName = "Foo", targetNamespace = "http://bar")
public interface TestService {
    String hello(String name);
}


And here the test class with service implementation:
package jaxws.example;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.concurrent.ForkJoinPool;

import javax.jws.WebService;
import javax.xml.namespace.QName;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Service;

public class Test {

    @WebService(endpointInterface = "jaxws.example.TestService")
    public static class TestServiceImpl implements TestService {

        @Override
        public String hello(final String name) {
            return "Hello " + name;
        }

    }

    @org.junit.Test
    public void test() throws MalformedURLException {
        final ForkJoinPool pool = ForkJoinPool.commonPool();
        final String address = "http://localhost:8888/service";

        final WebService annotation = TestService.class.getAnnotation(WebService.class);
        final String namespaceURI = annotation.serviceName();
        final String localPart = annotation.targetNamespace();
        final QName serviceName = new QName(namespaceURI, localPart);

        final TestServiceImpl tsi = new TestServiceImpl();
        final Endpoint endpoint = Endpoint.create(tsi);
        final HashMap<String, Object> props = new HashMap<String, Object>();
        props.put(Endpoint.WSDL_SERVICE, serviceName);
        endpoint.setProperties(props);
        endpoint.setExecutor(pool);
        endpoint.publish(address);

        final URL wsdlURL = new URL(address + "?wsdl");
        final Service s = Service.create(wsdlURL, serviceName);
        final TestService port = s.getPort(TestService.class);

        System.out.println(port.hello("World"));
    }

}


If something changed and some additional configuration is needed to make this code work, it would be good to mention this in the migration guide. If this is a bug, it would be great if this would be resolved until the Neon release.
Re: Current Neon version seems to prevent JDKs JAX-WS implementation from working [message #1734241 is a reply to message #1733468] Mon, 06 June 2016 13:59 Go to previous message
Max Bureck is currently offline Max BureckFriend
Messages: 19
Registered: April 2013
Junior Member
I just found that the bug was recently fixed (see here). With the most recent Neon builds the error does not occur anymore.
Previous Topic:p2.inf to define optional dependency from feature to plugin?
Next Topic:Can't run P2 director using EclipseStarter
Goto Forum:
  


Current Time: Sat Sep 22 23:24:51 GMT 2018

Powered by FUDForum. Page generated in 0.01551 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top