Getting java.net.SocketTimeoutException: Read timed out

5,189 views
Skip to first unread message

tin

unread,
Jan 4, 2009, 1:45:32 AM1/4/09
to Google Web Toolkit
Hi All,

I occassionally get this exception when my app's page is getting
downloaded in the broser. In my application, I make few rpc calls to
fetch the data once the JSP is downloaded by the browser.

Any help in this will greatly be appreciated. No concrete answer could
be found for this on the internet but it seeems others have faced this
problem too.

Stack Trace:

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.coyote.http11.InternalInputBuffer.fill
(InternalInputBuffer.java:747)
at org.apache.coyote.http11.InternalInputBuffer
$InputStreamInputBuffer.doRead(InternalInputBuffer.java:777)
at org.apache.coyote.http11.filters.IdentityInputFilter.doRead
(IdentityInputFilter.java:115)
at org.apache.coyote.http11.InternalInputBuffer.doRead
(InternalInputBuffer.java:712)
at org.apache.coyote.Request.doRead(Request.java:427)
at org.apache.catalina.connector.InputBuffer.realReadBytes
(InputBuffer.java:283)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:379)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:
298)
at org.apache.catalina.connector.CoyoteInputStream.read
(CoyoteInputStream.java:180)
at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
(RPCServletUtils.java:146)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
(RemoteServiceServlet.java:335)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:77)
at org.gwtwidgets.server.spring.GWTSpringController.handleRequest
(GWTSpringController.java:82)
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle
(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch
(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService
(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest
(FrameworkServlet.java:523)
at org.springframework.web.servlet.FrameworkServlet.doPost
(FrameworkServlet.java:463)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

rakesh wagh

unread,
Jan 4, 2009, 5:51:37 PM1/4/09
to Google Web Toolkit
Please provide more details on what you are doing. Are you getting
this error on client or server? How much time does your request waits?
Is it because of long executing methods? The error message clearly
reads that it is a time out exception. My guess is some operation on
server is taking more time than your time out values set.

For a better answer, give us more information.

Rakesh Wagh

Stephe...@paretopartners.com

unread,
Jan 5, 2009, 4:11:55 AM1/5/09
to Google Web Toolkit
I had a similar problem and i eventually tracked it down to a looping
rpc call.

If you doing a very large request (or many in very quick succession)
then you will have to read the apache docs and edit the settings in
your web.xml (possibly "keep alive") although with the default
settings of 1min before timeout this is unlikely.

Hope this helps,
Steve
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)- Hide quoted text -
>
> - Show quoted text -

paveltonev

unread,
Jan 10, 2009, 6:40:38 PM1/10/09
to Google Web Toolkit
Hello All,
I have same problem, using JBoss AS. The most interesting that this
situation occurs only and ifonly I have a very big delay when tracing
the route host i.e. something like 1400ms. I have tested my
application from many locations in the world today but only from one
where the connection seems to be unstable I had such a problem. Here
are my connector settings:

<Connector port="8009" address="${jboss.bind.address}"
emptySessionPath="true" enableLookups="false"
redirectPort="8443"
protocol="AJP/1.3" maxThreads="400"
connectionTimeout="600000"
compression="force"
/>


Following the documentation :
http://www.jboss.org/file-access/default/members/jbossweb/freezone/docs/2.1.0/config/printer/http.html
it seems that keepAliveTimeout = connectionTimeout = 600000 = 10 mins

I have lost all the day fixing this problem but nothing can be done
unfortunately. Any help is appreciated!

Best Regards,
Pavel Tonev

On 5 Ян, 11:11, "Stephen.sm...@paretopartners.com"
<Stephen.sm...@paretopartners.com> wrote:
> I had a similar problem and i eventually tracked it down to a looping
> rpc call.
>
> If you doing a very large request (or many in very quick succession)
> then you will have toreadthe apache docs and edit the settings in
> your web.xml (possibly "keep alive") although with the default
> settings of 1min before timeout this is unlikely.
>
> Hope this helps,
> Steve
>
> On Jan 4, 10:51 pm, rakesh wagh <rake...@gmail.com> wrote:
>
> > Please provide more details on what you are doing. Are you getting
> > this error on client or server? How much time does your request waits?
> > Is it because of long executing methods? The error message clearly
> > reads that it is a timeoutexception. My guess is some operation on
> > server is taking more time than your timeout values set.

JY

unread,
Jan 12, 2009, 8:26:18 AM1/12/09
to Google Web Toolkit
I've had this problem since my production deployment in May last year.
Receive about 10 such exceptions everyday. I've learnt to ignore them
as the exceptions can be generated even when the user do not incur any
loss of functionality. Observations in this thread is generally
accurate though, ie. it happens only when there is an unstable
connection.

On Jan 11, 7:40 am, paveltonev <pavelto...@gmail.com> wrote:
> Hello All,
> I have same problem, using JBoss AS. The most interesting that this
> situation occurs only and ifonly I have a very big delay when tracing
> the route host i.e. something like 1400ms. I have tested my
> application from many locations in the world today but only from one
> where the connection seems to be unstable I had such a problem. Here
> are my connector settings:
>
> <Connector port="8009" address="${jboss.bind.address}"
>          emptySessionPath="true" enableLookups="false"
> redirectPort="8443"
>          protocol="AJP/1.3" maxThreads="400"
> connectionTimeout="600000"
>          compression="force"
>         />
>
> Following the documentation :http://www.jboss.org/file-access/default/members/jbossweb/freezone/do...

paveltonev

unread,
Jan 12, 2009, 11:41:00 AM1/12/09
to Google Web Toolkit
Hello All,

The situation on my side is very interesting:
1) I have a backend ping service which follows for server
availability and receives information about new version of the
software, etc. etc. usually the transfered information here is just
some bytes.
2) Regular service which on user interaction transfers about 1-2kb
per user click back and forth and just this service fails to connect
to the server.

1) is working while 2) fails with this exception. Which is
interesting for me but let's continue. I tried to make a workaround of
the problem starting a timer which if 2) fails to connect to server
tries again and again and as a result I never succeed. It is
interesting that I have to reload the application to continue, is
there any workaround of this issue without application reload ? Can
somebody recommend another techniques for this problem, for example it
is interesting for me how GMail copes with the situation when there is
no connection and later restored ?

Best Regards,
Pavel Tonev
> > > settings of 1min beforetimeoutthis is unlikely.
>
> > > Hope this helps,
> > > Steve
>
> > > On Jan 4, 10:51 pm, rakesh wagh <rake...@gmail.com> wrote:
>
> > > > Please provide more details on what you are doing. Are you getting
> > > > this error on client or server? How much time does your request waits?
> > > > Is it because of long executing methods? The error message clearly
> > > > reads that it is a timeoutexception. My guess is some operation on
> > > > server is taking more time than yourtimeout values set.
Reply all
Reply to author
Forward
0 new messages