当服务器在调用 hessian 期间出现问题(可能是套接字重置)时,释放客户端将永远挂起
我有一个客户端通过 Hessian 调用服务器。在此期间,服务器不稳定,通常会出现 Socket 重置错误。并且客户端挂在以下日志处。那么我怎样才能释放这个日志但仍然保持应用程序运行。导致客户端永远挂起的原因是什么?谢谢
在 java.net.SocketInputStream.socketRead0(本机方法) 在 java.net.SocketInputStream.read(来源未知) 在 java.io.BufferedInputStream.fill(来源未知) 在 java.io.BufferedInputStream.read1(来源未知) 在 java.io.BufferedInputStream.read(来源未知) - 锁定<0x2159c988> (一个java.io.BufferedInputStream) 在 sun.net.www.http.HttpClient.parseHTTPHeader(来源未知) 在 sun.net.www.http.HttpClient.parseHTTP(来源未知) 在 sun.net.www.http.HttpClient.parseHTTPHeader(来源未知) 在 sun.net.www.http.HttpClient.parseHTTP(来源未知) 在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(来源未知)
I have a client calls to a server through Hessian. During that time the server is not stable and ussually have Socket reset error. And the client was hangs at the below log. So how can I release this log but still keep the application running. And what is the reason that make the client hang forever? Thanks
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x2159c988> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,HttpUrlConnection 没有超时。
您需要为此设置java系统属性:
http:// /docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
从命令行设置:
或从 Java 代码设置:
By default HttpUrlConnection has no timeouts.
You need to set java system properties for this:
http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
Set it from command line:
Or from Java code: