tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients
Date Sun, 10 Nov 2013 14:14:39 GMT
Using Tomcat 7.0.47 via TomEE 1.6.0 along with MyFaces 2.1.13

Recently, I have been experiencing the SocketTimeoutException when web
application is serving resources to 'mobile clients'. Yesterday, user was
attempting to login from mobile iPad via an internal wireless phone
connection. Since my web application is accessed by mobile clients and
since I started using TomEE (tomcat7 and myfaces), I have seen the 'Error
trying to load resource ...' (below), but I have not seen the
SocketTimeoutException until I recently started using Tomcat 7.0.47 and
MyFaces 2.1.13.

I saved the first occurrence (Nov 8, 2013) of this exception on gist[1] and
saved Nov 9, 2013 occurrence on gist as well. I do have a web/servlet
filter in place, and I assume that I can catch the SocketTimeoutException
(when client is mobile) to prevent the stacktrace in the log, but this
exception is 'now' being logged to tomcat7-stderr, but this
SocketTimeoutException was not logged with previous versions of Tomcat
7.0.x and MyFaces 2.1.x. I assume that this is new logging behavior of
MyFaces 2.1.13 (or there is something new about Tomcat 7.0.47) but I may be
mistaking.

Please see all below, and advise how I can prevent this exception, if I can
adjust some tomcat settings to increase the socket timeout value, or
recommendations about serving resources to 'mobile clients'. I'm thinking
that I can increase the expiration of client resources from my web/servlet
filter, so this will not occur as often. This exception does not occur
everytime, but i'm sure you can understand that this 'can' happen
frequently and sporadically, depending on the connection between server and
mobile-device-via-wireless-phone-connection.


localhost_access_log shows the follow (please note the filenames and time
difference between the 1, 2, and 3rd lines below)


x.x.x.x - - [09/Nov/2013:13:08:25 -0500] "GET
/webapp/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 10036

x.x.x.x - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -

x.x.x.x - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -


tomcat7-stderr

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException
at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:413)

Caused by: java.net.SocketTimeoutException
at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:127)
at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
at
org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery-plugins.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException

Caused by: java.net.SocketTimeoutException
at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:127)
at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
at
org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)


[1] https://gist.github.com/smithh032772/7380812

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message