简体   繁体   English

Glassfish抛出com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码500:内部服务器错误

[英]Glassfish throws com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 500: Internal Server Error

I have deployed jax-ws web service into glassfish 3.1.My client request for the service method which returns 5000 to 10000 list of objects.In between processing server throws ClientTransportException with following stack-trace. 我已经将jax-ws Web服务部署到glassfish 3.1中,我对服务方法的客户端请求返回了5000到10000个对象列表。在两次处理之间,处理服务器抛出ClientTransportException并带有以下堆栈跟踪。

com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 500: Internal Server Error
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:314)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:265)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:184)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:109)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
at com.sun.xml.ws.client.Stub.process(Stub.java:323)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:161)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:113)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:144)
at $Proxy190.webservicemethodcall(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

I try to monitor the glassfish request but it show errorcount 1 in request statistics but it don't provide me any proper reason of errorcount. 我尝试监视glassfish请求,但是它在请求统计信息中显示errorcount 1,但它没有提供任何正确的errorcount原因。 It has been observed in multiple test,i got the client Transport at client but at server the method thread separately working properly up to last line.It don't aware of broken connection. 在多次测试中都观察到了这一点,我在客户端处传输了客户端,但是在服务器端,方法线程分别正常工作到最后一行。它不知道连接断开。 I think that the connection is broken so thread can not return the response at last. 我认为连接已断开,因此线程最终无法返回响应。

Note : If return response is small like up to 3000 objects it works fine.But i don't thing it is matter of size.It is matter of timeout.My request connection is broken before creating responce 注意:如果返回响应很小(最多可容纳3000个对象),则可以正常工作。但是我不认为这是大小问题。它是超时问题。我的请求连接在创建响应之前就断开了

Please help me 请帮我

A HTTP 500 means Internal Server Error, which is no fault of your client. HTTP 500表示内部服务器错误,这不是您的客户端的错误。 Something about your request is failing on the server. 有关您的请求的信息在服务器上失败。 You should look there for more info. 您应该在此处查找更多信息。 Your client side stack trace isn't going to help. 您的客户端堆栈跟踪将无济于事。

You can try any combination of the following: 您可以尝试以下任意组合:

  1. While your request is running, run a continuous ping from the client. 在您的请求运行时,从客户端运行连续ping。 You should see a break in the pinging (or an increase in TTL at least to confirm the theory) 您应该会发现ping中断(或至少增加了TTL以确认理论)

  2. Set the following JVM property for a dump of the HTTP message exchange between server and client 为服务器和客户端之间的HTTP消息交换的转储设置以下JVM属性

     -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true 
  3. Try TCPMon 试试TCPMon

  4. Implement a JAX-WS SOAP Handler to capture the exact moment when the pipe runs dry. 实现一个JAX-WS SOAP处理程序,以捕获管道干了的确切时刻。 This might have the extra benefit of throwing a meaningful exception when the handler attempts to log a message and gets burnt by the absent message 当处理程序尝试记录消息并被缺少的消息烧毁时,这可能具有抛出有意义的异常的额外好处。

If your logging policy is not clearly defined, your exception might be silently swallowed on server side. 如果未明确定义日志记录策略,则服务器端可能会悄悄吞下您的异常。

I would try to add a try/catch block to detect where this happens (and eventually remove it later if you improve your logging strategy) 我会尝试添加一个try / catch块来检测发生这种情况的位置(如果您改进了日志记录策略,则最终将其删除)

public returnType yourMethod(){
    try {
    .... all your code
    }catch (final Throwable t) {
      log.error("Failed to wait for device update: " + t.getMessage());
      //eventually re-throw the error
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 线程“ main” com.sun.xml.internal.ws.client.ClientTransportException中的异常:服务器发送了HTTP状态代码502:代理错误 - Exception in thread “main” com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 502: Proxy Error 使用CXF从Java消耗Web服务会导致com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码200:确定 - Consuming webservice from java using CXF results in com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 200: OK 连接到 web 服务导致 com.sun.xml.internal.ws.client.ClientTransportException:服务器发送 HTTP 状态码 200 - Connecting to webservice results in com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK com.sun.xml.ws.client.ClientTransportException:HTTP传输错误:java.lang.ClassCastException - com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.lang.ClassCastException com.sun.xml.ws.client.ClientTransportException:请求需要HTTP身份验证:未经授权 - com.sun.xml.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized JAX WS com.sun.xml.internal.ws.client.ClientTransportException:HTTP 传输错误:java.net.ConnectException:连接被拒绝 - JAX WS com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused com.sun.xml.internal.ws.client.ClientTransportException:HTTP传输错误:java.net.SocketException:连接重置 - com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.SocketException: Connection reset HTTP状态500-Glassfish上的内部服务器错误 - HTTP Status 500 - Internal Server Error on Glassfish GlassFish Http状态500-内部服务器错误 - GlassFish Http Status 500 - Internal Server Error 导入com.sun.xml.internal.ws.client.ClientTransportException,无法读取此导入 - import com.sun.xml.internal.ws.client.ClientTransportException, can't read this import
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM