2012-02-22 2 views
3

私は、HTML管理ページを提供する埋め込みJettyサーバがあり、いくつかのWebサービスを統合する必要があるプロジェクトに取り組んでいます。 Webサービスの作業罰金WebサービスのSPIプロバイダとして埋め込まれたJettyは、クライアントにwebfaultを送信しません。

... 
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); 
... 

、しかし、ときに私はwebfaultを投げる:私はthosesサービスを構築し、デフォルトいるHttpServerProviderを置き換えるために桟橋SPIの実装(桟橋-jaxws2-SPI)を使用するJAX-WSとのjavaxのxml注釈を使用します例外として、クライアントは本文コンテンツのないHTTP 200結果コードのみを取得します。 httpserverproviderをデフォルトの実装に戻して、障害がクライアントに正しく送信されます。

jetty-jaxws2-spiの実装には何か不足がありますが、何がわからないのでしょうか。

更新: JAVAのバージョンおよびJAX LIBSの間の互換性の問題のようです。私が手に承認ディレクトリ内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が必要です。 いまいましい...

答えて

0

を解決:

私の承認ディレクトリにJAX-WS RI 2.1.7およびJAXB 2.1.12 jarファイルを追加します。

関連する問題