Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Exception deploying Servlet and Metro WS

Hello,

I have an embedded Jetty 9.2.1 server in my application where I have deployed a servlet in a ServletContextHandler. At the same time I want to deploy a Metro WS in the same server using JettyHttpServerProvider, but when I try to publish the
WS Endpoint I get the following exception:

Caused by: com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.lang.UnsupportedOperationException: !DelegatingThreadPool at com.sun.xml.internal.ws.transport.http.server.ServerMgr.createContext(ServerMgr.java:102) at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:63) at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:171) at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:118)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:240)

If I use two Jetty server instances embedded in my application and listening in different ports, all work properly, but I would like to share the same port among the servlet and the Metro WS.

My faulty code follows:

-------------------------------------------------
Server server = new Server(8080);

System.setProperty("com.sun.net.httpserver.HttpServerProvider",
"org.eclipse.jetty.http.spi.JettyHttpServerProvider");
JettyHttpServerProvider.setServer(server);

ContextHandlerCollection contexts = new ContextHandlerCollection();

servletContext =  new ServletContextHandler(server, "/myapp", true, false);
contexts.addHandler(servletContext);

ServletHolder servletHolder = new ServletHolder(MyServlet);
servletContext.addServlet(servletHolder, "/servlet-path");

HandlerCollection handlerCollection = new HandlerCollection();
handlerCollection.setHandlers(new Handler[]{ contexts });

Endpoint endpoint = Endpoint.publish(endpointURL, myWebServices);

server.setHandler(contexts);

server.start();
-------------------------------------------------

Any idea ?
Thanks.

---
Alejandro Alberola
Bio Data Systems
---



Back to the top