eclipse 线程“main”org.apache.axis2.AxisFault 中的异常:读取超时
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7412254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exception in thread "main" org.apache.axis2.AxisFault: Read timed out
提问by Isuru
I wrote a web service and web client was generated using Eclipse wizard.
And my client application is requesting a String
and also an Object
.
The string can be retrieved successfully and when I tried to retrieve the object it gives the following exception (I'm using JBoss 5):
我编写了一个 Web 服务,并使用 Eclipse 向导生成了 Web 客户端。我的客户端应用程序请求一个String
和一个Object
. 可以成功检索字符串,当我尝试检索对象时,它给出以下异常(我使用的是 JBoss 5):
Exception in thread "main" org.apache.axis2.AxisFault: Read timed out
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at se.cambio.cimonitor.ws.implmnt.GetDataStub.retrieveDetails(GetDataStub.java:203)
at se.cambio.cimonitor.ws.client.WebServiceClient.main(WebServiceClient.java:44)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1373)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:560)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
I cannot find a way out, please help me.
我找不到出路,请帮帮我。
回答by Buhake Sindi
I can only provide help from the only exception stack trace you've place.
我只能从您放置的唯一异常堆栈跟踪中提供帮助。
The rootcause of the exception is:
异常的根本原因是:
Caused by: java.net.SocketTimeoutException: Read timed out
引起:java.net.SocketTimeoutException:读取超时
It means that a timeout has occurred when the socket tried to read or accept. In your case there was a read timeout.
这意味着当套接字尝试读取或接受时发生了超时。在您的情况下,存在读取超时。
You need to figure out what is your socket timeout to the service server box and if you can, make it live indefinitely.
您需要弄清楚服务服务器框的套接字超时时间是多少,如果可以的话,让它无限期地存活。
回答by Shawn
I ran into this error on a project, and the root cause was a proxy server setting. I had to modify the proxy to allow the communication to the service I was trying to hit. My code was running as part of a custom application that used its own proxy. So this may also be something to try.
我在一个项目中遇到了这个错误,根本原因是代理服务器设置。我不得不修改代理以允许与我试图访问的服务进行通信。我的代码作为使用自己代理的自定义应用程序的一部分运行。所以这也可能是值得尝试的。
回答by Mayur
We faced similar issue and we were getting Read Time Out while trying to invoke a secured webservice, after a long analysis we found out that there was a mismatch in the transport protocol version. Web-service was servicing on http1.0 and we were invoking it using http1.1. We modified the protocol version in our client code which resolves this issue:
我们遇到了类似的问题,在尝试调用安全的 Web 服务时出现读取超时,经过长时间的分析,我们发现传输协议版本不匹配。Web 服务在 http1.0 上提供服务,我们使用 http1.1 调用它。我们在解决此问题的客户端代码中修改了协议版本:
Below is the code to specify http version-1.0 options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION, org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);
下面是指定http version-1.0 options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION, org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10)的代码;
回答by Isuru
Finally I could overcome the problem. My object was an object which contains another objects inside that. Then I construct a one object with String and int and could send successfully.
最后我可以克服这个问题。我的对象是一个包含另一个对象的对象。然后我用 String 和 int 构造一个对象并且可以成功发送。
Thank you...
谢谢...