5

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.

AlexVogel
  • 10,601
  • 10
  • 61
  • 71
Bender
  • 145
  • 2
  • 4
  • 8
  • I having same Issue.. Even increasing Timeout period, I still facing this Exception sometimes... Please post your solution if you achieved.. – Nirav Dangi Sep 27 '13 at 07:04
  • 2
    For the record this may not be relevant but is an observation of an issue I faced that produced the same error, we ran a re-indexing of our MySQL database on Tomcat that accidentally took up 300% CPU. Meaning connection to our service threw SocketTimeOutErrors...something similar may cause issues on other Tomcat servers I imagine. To fix it, we obviously just killed the process. – Ed Holloway-George Nov 12 '13 at 13:14

1 Answers1

-2

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.

Old Pro
  • 24,624
  • 7
  • 58
  • 106
  • Even increasing `_call.setTimeout(xxxx)` I still have the problem. It's supose that `_call.setTimeout(xxxx)` have to be between **Debugger timeout** and **Launch timeout**, isn't? – Bender May 28 '13 at 09:39
  • There are so many possibilities and it is too hard to put all the relevant details of your setup into a question here. You need to find someone who can help you in person. – Old Pro May 28 '13 at 09:46
  • I thought that the logic was that, but I try to change ´_call.setTimeout(3000 or 6000, etc)´ and always makes the webservice, but sometimes give me this exception , sometimes not and I don't understand why, even putting the **Debugger timeout and Launch timeout** in the maximun or minimun possibles, still happen. I look the other Questions in this forum about this exception and nothing – Bender May 28 '13 at 10:04