有时候java.net.SocketTimeoutException:读取超时。有时不是 [英] Sometimes java.net.SocketTimeoutException: Read timed out. Sometimes not

查看:183
本文介绍了有时候java.net.SocketTimeoutException:读取超时。有时不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个奇怪的错误与

  java.net.SocketTimeoutException:读取超时

也许有人可以帮助解决这个问题。



事实是这些,我正在使用 Eclipse ,使用 Tomcat v7 。然后我执行一个函数,它有

  _call.setTimeout(3500); 

在我的 Windows->首选项 - > Java->调试调试器超时(ms):3000
启动超时(ms):20000

在我的服务器 - > Tomcat v7.0->超时中我有

 开始(以秒为单位):45 
停止(以秒为单位):15

现在,当我运行我的WebService,有时它的工作是完美的,有时我得到 RemoteException e2:java.net.SocketTimeoutException:读取超时



我是否正确设置了超时
因为我试图改变它,而且静止是一样的,有时会得到错误,有时不会

解决方案

显然,有时您正在进行的呼叫需要超过3.5秒才能完成。在这种情况下,得到一个 SocketTimeoutException 是预期的行为。


I have this strange error with the

java.net.SocketTimeoutException: Read timed out

And maybe someone of you can help to fix this problem.

The facts are these, I'm working with Eclipse, with a Tomcat v7. Then I execute a function which have

_call.setTimeout(3500);

In my Windows->Preferences->Java->Debug I have

Debugger timeout(ms):3000
Launch timeout(ms):20000

In my Servers->Tomcat v7.0->Timeouts I have

Start(in seconds): 45
Stop(in seconds): 15

Now, when I run my WebService, sometimes it works perfect, sometimes I get the RemoteException e2: java.net.SocketTimeoutException: Read timed out

Did I set the Timeout correctly? Because I tried to change it and stills happens the same, sometimes gets the error, sometimes not.

解决方案

Apparently, sometimes the call you are making takes longer than 3.5 seconds to complete. In that case, getting a SocketTimeoutException is the expected behavior.

这篇关于有时候java.net.SocketTimeoutException:读取超时。有时不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆