Opublikuj punkt końcowy JAX-WS z osadzonym Jetty 7
Czy ktoś może w tym pomóc?
Chcę użyć osadzonego Jetty 7 jako punktu końcowego. To właśnie próbowałem:
public class MiniTestJetty {
@WebService(targetNamespace = "http")
public static class Calculator {
@Resource
WebServiceContext context;
public int add(int a, int b) {
return a + b;
}
}
public static void main(String[] args) throws Exception {
int port = 8080;
Server server = new Server(port);
Calculator calculator = new Calculator();
Endpoint.publish("http://localhost:" + port + "/calc", calculator);
server.start();
server.join();
}
}
Ale nie widzę, czy to naprawdę używa Jetty zamiast domyślnego Sun HttpServer.
Jeden blog wspomniany
System.setProperty("com.sun.net.httpserver.HttpServerProvider",
"org.mortbay.jetty.j2se6.JettyHttpServerProvider");
Ale w Jetty 7 nie wydaje się być taki HttpServerProvider.
Dziękuję za wszelką pomoc, Axel.