Sometimes java.net.SocketTimeoutException: Read ti

2019-05-03 08:14发布

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.

1条回答
家丑人穷心不美
2楼-- · 2019-05-03 08:55

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.

查看更多
登录 后发表回答