2012/3/29 Osipov, Michael <michael.osi...@siemens.com>:
> Hi folks,
>
> I am trying to narrow down an exception which is happening occasionally in 
> certain spots of your code:
>
> SCHWERWIEGEND: Servlet.service() for servlet default threw exception
> Java.net.SocketTimeoutException
>        at 
> org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796)
> ...
>
> The problematic spot in that file is:
> if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) {
>                    throw new 
> SocketTimeoutException(sm.getString("iib.failedread"))
>
> Not to mention that 'iib.failedread' does not exists in the properties file, 
> I cannot localize the failing point whether it's the client who's 
> resetting/closing the connection or is it libtcnative?


It says "timeout" and it occurs while reading, so I would say that the
client is slow at delivering data (disappeared without closing the
connection), so read operation times out.

The native side (network.c in native/branches/1.1.x/native/src) just
calls (tcn_nlayer_t)->recv,  which has two different implementations,
depending on whether ssl is used or not used (network.c vs
sslnetwork.c).


The timeout on the socket should be configurable (probably see
AprEndpoint#setSocketOptions(..)), but I do not see specific mention
of that option in the documentation.

It is a bit strange that soTimeout in setSocketOptions() is multiplied
by 1000. I'd expect the option to be in milliseconds, like documented
options. I cannot say without digging further into the code -- maybe
it is divided by 1000 somewhere else.

> My client code does this:
> private JSONObject getJSON(HttpServletRequest request) throws IOException {
>                String jsonBody = IOUtils.toString(request.getInputStream(), 
> "UTF-8");
>                return JSONObject.fromObject(jsonBody);
>        }
>
> Is there any clue where I can start digging for this problem? If the client 
> (IE) is failing, I can't do anything about it but if my code is the problem...
>
> I am on
> bash $ uname -a
> HP-UX blnn725x B.11.23 U ia64
> bash $ /opt/java6/bin/java -version
> java version "1.6.0.13"
> Java(TM) SE Runtime Environment (build 1.6.0.13-jinteg_01_dec_2011_03_39-b00)
> Java HotSpot(TM) Server VM (build 20.3-b02-jre1.6.0.13-rc1b1, mixed mode)
> Tomcat 6.0.35
> Libtcnative 1.1.22
> Client IE8 on Windows XP.
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to