HTML管理ページを提供するための組み込みのjettyサーバーがあり、いくつかのWebサービスを統合する必要があるプロジェクトに取り組んでいます。jax-ws および javax xml アノテーションを使用してこれらのサービスを構築し、jetty SPI 実装 (jetty-jaxws2-spi) を使用してデフォルトの HttpServerProvider を置き換えます。
...
System.setProperty("com.sun.net.httpserver.HttpServerProvider","org.eclipse.jetty.jaxws2spi.JettyHttpServerProvider");
HttpsServer httpsServer = HttpsServer.create(new InetSocketAddress(serverPort),0);
...
HttpContext httpContext = httpsServer.createContext("/ws/myservice");
Endpoint endpoint = Endpoint.create(new AuthenticateImpl());
endpoint.publish(httpContext);
...
Web サービスは正常に動作しますが、webfault 例外をスローすると、クライアントは本文コンテンツのない HTTP 200 結果コードのみを取得します。httpserverprovider をデフォルトの実装に戻すと、障害がクライアントに正しく送信されます。
jetty-jaxws2-spi の実装に何かが欠けていると思いますが、何がわかりません。
何か案が ?
更新: JAVA バージョンと JAX ライブラリ間の互換性の問題のようです。
承認されたディレクトリにjava7とjaxb-apiとjaxb-impl(2.1.12)を使用すると、次のようになります。
java.lang.ExceptionInInitializerError
at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:254)
at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:85)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:299)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:593)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
at org.eclipse.jetty.jaxws2spi.JAXWS2ContextHandler.doScope(JAXWS2ContextHandler.java:75)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1065)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.<clinit>(SOAPFaultBuilder.java:550)
... 25 more
デフォルトの http 応答 (200) につながります...
更新 2
承認されたディレクトリから jaxb-impl と jaxb-api を削除すると、webfault が機能します。しかし、それを行うと、jersey から Natural JSON 表記を取得できません。jaxb 2.1.12 が必要です。くそ ...