You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Wang <wa...@gmail.com> on 2008/10/03 03:50:47 UTC

Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Hi Mark,
We also found sometimes the Request.getparameter("parm") statement was
return null,
wondering if it's connected to the SocketTimoutException error, So we made a
mirror
changes on org.apache.catalina.connector.Request.java trying to track what
the Actual
Length was each time when tomcat read the post body part, it's weird because
we found
the Actual Length was either equal to the content-length or zero (whole body
part was
missing), would it get back to normal if we disable the keep-alive ?

Following is the changes I made on Request.java for your reference:

  protected void parseParameters() {

    :      :       :      :
    :      :       :      :

                if (actualLen == len) {
                    parameters.processParameters(formData, 0, len);
                }
                else { // added by me
                    context.getLogger().error("formData Len error len :" +
len + " <> actualLen :" + actualLen);
                }
            } catch (Throwable t) {
                context.getLogger().warn
                    (sm.getString("coyoteRequest.parseParameters"), t);
            }
        }

    }

Following was the Tomcat log :

SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :379 <> actualLen :0
SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :41 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0
SEVERE: formData Len error len :74 <> actualLen :0
SEVERE: formData Len error len :145 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0

Thanks & Best Regards.
James Wang


On Fri, Sep 5, 2008 at 10:26 PM, Mark Thomas <ma...@apache.org> wrote:

> James Wang wrote:
> > Hi all,
> >
> > we are encountering java.net.SocketTimeoutException: Read timed out
> > occasionally,
> > wondering if it's something related to network problem,
> > Would highly appreciate if someone can help, following are the program
> stack
> If the client is IE, the server httpd and you are using Keep-Alive try
> disabling it.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by Martin Gainty <mg...@hotmail.com>.
agreed
there is a framework setup to handle Ajax calls based on pageLoad, timers, listen topics
http://struts.apache.org/2.x/docs/ajax-and-javascript-recipes.html

ping me offline for details
Martin Gainty 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> From: john@kewlstuff.co.za
> To: users@tomcat.apache.org
> Subject: Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally
> Date: Mon, 13 Oct 2008 13:10:55 +0200
> 
> 
> ----- Original Message ----- 
> From: "James Wang" <wa...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, October 13, 2008 11:35 AM
> Subject: Re: question : encounter java.net.SocketTimeoutException: Read 
> timed out occasionally
> 
> 
> > Hi Johnny,
> >
> > Yes, We are using ajax to make the post requests, and the header do 
> > include
> > content-length information that was calculated by ajax automatically, but
> > the
> > strange thing is sometime it get stuck at the begin of uploading http 
> > body(0
> > byte
> > was transfered always in this case) until AJP connector timeout, actually 
> > we
> > have revised a little bit on tomcat source code, below is our finding we
> > made
> > the change on org.apache.catalina.connector.Request.java for your 
> > reference
> > :
> >
> > protected void parseParameters() {
> >
> >    :      :       :      :
> >    :      :       :      :
> >
> >                if (actualLen == len) {
> >                    parameters.processParameters(formData, 0, len);
> >                }
> >                else { // added by me
> >                    context.getLogger().error("formData Len error len :" +
> > len + " <> actualLen :" + actualLen);
> >                }
> >            } catch (Throwable t) {
> >                context.getLogger().warn
> >                    (sm.getString("coyoteRequest.parseParameters"), t);
> >            }
> >        }
> >
> >    }
> >
> > Following was the Tomcat log, actualLen always return 0,
> > the first line showing the content-length is 32 but the returned
> > actual length is 0.
> >
> > SEVERE: formData Len error len :32 <> actualLen :0
> > SEVERE: formData Len error len :379 <> actualLen :0
> > SEVERE: formData Len error len :32 <> actualLen :0
> > SEVERE: formData Len error len :41 <> actualLen :0
> > SEVERE: formData Len error len :60 <> actualLen :0
> > SEVERE: formData Len error len :74 <> actualLen :0
> > SEVERE: formData Len error len :145 <> actualLen :0
> > SEVERE: formData Len error len :60 <> actualLen :0
> >
> > Thanks & Best Regards.
> > James Wang
> > On Mon, Oct 13, 2008 at 4:34 PM, Johnny Kewl <jo...@kewlstuff.co.za> wrote:
> 
> James... dont know... couple of thing you can do... get wire shark and 
> actually watch whats on the wire... if the header is coming in and no body 
> is sent, it aint tomcat...
> My Ajax is stale... if you doing it yourself, then its very like a 
> javascript issue.... cant remember details but its not unusual in the Ajax 
> stuff to see...
> ... if(IE) do it all different...
> ... I think you working on the wrong side... its that Ajax, is my guess....
> 
> My guess is that it works with Firefox perfectly... but not on IE and you 
> dont have a debugger for that... welcome to Javascript ;) on diff browsers 
> its a nightmare ;)
> Good luck, or maybe post the Ajax snippet and see if the guys can spot it...
> 
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
> If you cant pay in gold... get lost...
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by James Wang <wa...@gmail.com>.
Hi Mark & all,

After using the Jpcap (java sniffer tool) to watch the http packets, We
Finally
found out the root cause of this problem is indeed the keep-live BUG of
Internet
Explorer, below is our finding for your reference :

Finding 1 : When using AJAX to make http requests, Internet Explorer always
sends
            http header and body separately in 2 (or more) IP packets. and
in our
            case the header is always sent in the first packet since the
header
            length is never greater than 1460 bytes(Maximum packet data
size).

Finding 2 :

          1) When apache httpd server detects the keep-live timeout, it will
send
             a Fin (finish) Packet to Client (IE) telling it to close the
connection,
             but at meanwhile Client is preparing to send another POST
request to Apache,
             for unknown reasons (IE BUG!) IE still keeps sending the POST
head & body instead
             of closing connection immediately.

          2) Apache server will ignore the POST request. and send the ACK
Packet back
             to Client.

          3) and next, the Client sends a Fin(Finished) Packet to apache
server to confirm
             closing connection.

          4) Apache server sends an ACK packet to confirm ending this
connection.


          5) Next, Client resend the POST header again to Apache server.

          6) Apache Server confirm receiving the header.

          7) after about 1.5 minutes, Client send a RST (Reset) packet to
Apache
             Server asking reset the connection. In this case the POST body
is
             never sent to Apache server that causes the request parameters
is
             missing.

Following is the Packet flow for your reference : (Time format hhms.S)


   Time              From        to          SEQ         ACK
Flag        remark
   ========  ======   ======  =======  =========  ====
====================================
   071249.751   Client   Apache  1088748537   1807070026           previous
conversion sent from Client
   071304.243   Apache   Client  1807070026  1088748537
FIN     time-out(idle 15 seconds)
   071304.467   Client   Apache  1088748537  1807070026  PSH   Client still
sends POST header
   1807070027   Apache   Client  1807070027  1088749235
   1088749235   Client   Apache  1088749235  1807070026  PSH   Client still
sends POST body
   071304.479   Apache   Client  1807070027  1088749316
   071304.720   Client   Apache  1088749316  1807070027
   071304.721   Client   Apache  1088749316  1807070027  Fin     Finish the
connection
   071304.722   Apache   Client  1807070027  1088749317            Server
confirm ending the connection

   071304.737   Client   Apache  1959299521  1807484246  PSH   Client resend
the Post header in another connection
   071304.737   Apache   Client  1807484246  1959300219            Apache
confirm receiving this header
   071425.235   Client   Apache  1959300219  1807484246  RST   after about
1.5 minutes, Client request to reset the connection
In conclusion, the problem  only happens when Keep-Alive is timeout, that's
why it's related to the apache keep-alive
setting, smaller keep-alive timeout will raise the timeout frequency and
cause more missing body part errors as well.

Unfortunately, so far there is no solution yet unless Microsoft fix the BUG.


Thanks
James.

>
>
>

Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by doktorkloebner <kr...@gmail.com>.
Hi all,
we've been having the same Exception and Stack Trace in an application we've
written for a customer. Our application is running on Tomcat 5.5.25 accessed
through Apache with ModJk.

The Exception occurs when a client accesses the server with a slow
connection and plenty of data is posted to the server during the request.
The request parameters contained in the posted data are null when we try to
access them in our java code.

What we'll test next is to increase the keep-alive timeout of Apache and see
if that helps. The downside of this being trouble if there are many Clients
accessing the server at the same time.

Another solution according to other posts in other forums might be an
upgrade to tomcat 6. 

If the clients access the tomcat-server directly without apache in front of
it, the error does not occur at all, so it seems to have something to do
with modJK. Plus - in our case - the error has nothing to do with IE (for a
change).

Just wanted to let you know...

Cheers,
Alex



Johnny Kewl wrote:
> 
> 
> ----- Original Message ----- 
> From: "James Wang" <wa...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, October 13, 2008 11:35 AM
> Subject: Re: question : encounter java.net.SocketTimeoutException: Read 
> timed out occasionally
> 
> 
>> Hi Johnny,
>>
>> Yes, We are using ajax to make the post requests, and the header do 
>> include
>> content-length information that was calculated by ajax automatically, but
>> the
>> strange thing is sometime it get stuck at the begin of uploading http 
>> body(0
>> byte
>> was transfered always in this case) until AJP connector timeout, actually 
>> we
>> have revised a little bit on tomcat source code, below is our finding we
>> made
>> the change on org.apache.catalina.connector.Request.java for your 
>> reference
>> :
>>
>> protected void parseParameters() {
>>
>>    :      :       :      :
>>    :      :       :      :
>>
>>                if (actualLen == len) {
>>                    parameters.processParameters(formData, 0, len);
>>                }
>>                else { // added by me
>>                    context.getLogger().error("formData Len error len :" +
>> len + " <> actualLen :" + actualLen);
>>                }
>>            } catch (Throwable t) {
>>                context.getLogger().warn
>>                    (sm.getString("coyoteRequest.parseParameters"), t);
>>            }
>>        }
>>
>>    }
>>
>> Following was the Tomcat log, actualLen always return 0,
>> the first line showing the content-length is 32 but the returned
>> actual length is 0.
>>
>> SEVERE: formData Len error len :32 <> actualLen :0
>> SEVERE: formData Len error len :379 <> actualLen :0
>> SEVERE: formData Len error len :32 <> actualLen :0
>> SEVERE: formData Len error len :41 <> actualLen :0
>> SEVERE: formData Len error len :60 <> actualLen :0
>> SEVERE: formData Len error len :74 <> actualLen :0
>> SEVERE: formData Len error len :145 <> actualLen :0
>> SEVERE: formData Len error len :60 <> actualLen :0
>>
>> Thanks & Best Regards.
>> James Wang
>> On Mon, Oct 13, 2008 at 4:34 PM, Johnny Kewl <jo...@kewlstuff.co.za>
>> wrote:
> 
> James... dont know... couple of thing you can do... get wire shark and 
> actually watch whats on the wire... if the header is coming in and no body 
> is sent, it aint tomcat...
> My Ajax is stale... if you doing it yourself, then its very like a 
> javascript issue.... cant remember details but its not unusual in the Ajax 
> stuff to see...
> ... if(IE) do it all different...
> ... I think you working on the wrong side... its that Ajax, is my
> guess....
> 
> My guess is that it works with Firefox perfectly... but not on IE and you 
> dont have a debugger for that... welcome to Javascript ;) on diff browsers 
> its a nightmare ;)
> Good luck, or maybe post the Ajax snippet and see if the guys can spot
> it...
> 
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
> If you cant pay in gold... get lost...
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/question-%3A-encounter-java.net.SocketTimeoutException%3A-Read-timed-out-occasionally-tp19326602p19993182.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: "James Wang" <wa...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, October 13, 2008 11:35 AM
Subject: Re: question : encounter java.net.SocketTimeoutException: Read 
timed out occasionally


> Hi Johnny,
>
> Yes, We are using ajax to make the post requests, and the header do 
> include
> content-length information that was calculated by ajax automatically, but
> the
> strange thing is sometime it get stuck at the begin of uploading http 
> body(0
> byte
> was transfered always in this case) until AJP connector timeout, actually 
> we
> have revised a little bit on tomcat source code, below is our finding we
> made
> the change on org.apache.catalina.connector.Request.java for your 
> reference
> :
>
> protected void parseParameters() {
>
>    :      :       :      :
>    :      :       :      :
>
>                if (actualLen == len) {
>                    parameters.processParameters(formData, 0, len);
>                }
>                else { // added by me
>                    context.getLogger().error("formData Len error len :" +
> len + " <> actualLen :" + actualLen);
>                }
>            } catch (Throwable t) {
>                context.getLogger().warn
>                    (sm.getString("coyoteRequest.parseParameters"), t);
>            }
>        }
>
>    }
>
> Following was the Tomcat log, actualLen always return 0,
> the first line showing the content-length is 32 but the returned
> actual length is 0.
>
> SEVERE: formData Len error len :32 <> actualLen :0
> SEVERE: formData Len error len :379 <> actualLen :0
> SEVERE: formData Len error len :32 <> actualLen :0
> SEVERE: formData Len error len :41 <> actualLen :0
> SEVERE: formData Len error len :60 <> actualLen :0
> SEVERE: formData Len error len :74 <> actualLen :0
> SEVERE: formData Len error len :145 <> actualLen :0
> SEVERE: formData Len error len :60 <> actualLen :0
>
> Thanks & Best Regards.
> James Wang
> On Mon, Oct 13, 2008 at 4:34 PM, Johnny Kewl <jo...@kewlstuff.co.za> wrote:

James... dont know... couple of thing you can do... get wire shark and 
actually watch whats on the wire... if the header is coming in and no body 
is sent, it aint tomcat...
My Ajax is stale... if you doing it yourself, then its very like a 
javascript issue.... cant remember details but its not unusual in the Ajax 
stuff to see...
... if(IE) do it all different...
... I think you working on the wrong side... its that Ajax, is my guess....

My guess is that it works with Firefox perfectly... but not on IE and you 
dont have a debugger for that... welcome to Javascript ;) on diff browsers 
its a nightmare ;)
Good luck, or maybe post the Ajax snippet and see if the guys can spot it...

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------
If you cant pay in gold... get lost...



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by James Wang <wa...@gmail.com>.
Hi Johnny,

Yes, We are using ajax to make the post requests, and the header do include
content-length information that was calculated by ajax automatically, but
the
strange thing is sometime it get stuck at the begin of uploading http body(0
byte
was transfered always in this case) until AJP connector timeout, actually we
have revised a little bit on tomcat source code, below is our finding we
made
the change on org.apache.catalina.connector.Request.java for your reference
:

protected void parseParameters() {

    :      :       :      :
    :      :       :      :

                if (actualLen == len) {
                    parameters.processParameters(formData, 0, len);
                }
                else { // added by me
                    context.getLogger().error("formData Len error len :" +
len + " <> actualLen :" + actualLen);
                }
            } catch (Throwable t) {
                context.getLogger().warn
                    (sm.getString("coyoteRequest.parseParameters"), t);
            }
        }

    }

Following was the Tomcat log, actualLen always return 0,
the first line showing the content-length is 32 but the returned
actual length is 0.

SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :379 <> actualLen :0
SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :41 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0
SEVERE: formData Len error len :74 <> actualLen :0
SEVERE: formData Len error len :145 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0

Thanks & Best Regards.
James Wang
On Mon, Oct 13, 2008 at 4:34 PM, Johnny Kewl <jo...@kewlstuff.co.za> wrote:

>
> ----- Original Message ----- From: "James Wang" <wa...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, October 13, 2008 7:11 AM
> Subject: Re: question : encounter java.net.SocketTimeoutException: Read
> timed out occasionally
>
>
> Hi Mark,
>>
>> In order to find out if the problem of Request.getParameter("parm") return
>> null (missing post
>> body part) is related to http keep-alive,  We've tried to reduce
>> the KeepaliveTimeout setting in
>> Apache httpd server from 15 seconds to 5 seconds,  the strange thing
>> happened, We found
>> the null parameter count was raised from 400/per-day (in average) to 900
>> times/per-day.
>> The next step we are going to disable the keep-alive and see what will
>> happen, will let you
>> know the result for reference.
>>
>> If disabling keeplive could resolve this problem, the mysterious part then
>> is why the
>> the browser get stuck on uploading the post body part always.
>>
>
> James, what is actually doing the post?... Ajax?
> Look I dont know, but it smells like a data size problem...
> Something like a header size is saying... you going to get 500 bytes and
> only 499 come in... so now the browser is waiting for the stupid server to
> reply, and the server thinks the stupid browser is just slow... eventually
> TCP sockets say... good bye, you guys are just too slow.
> So socket time out, I think, is not the real issue... some header size is
> wrong... maybe something subtle like its multibyte and the header size is
> calculating bytes.
> If you click twice and then the 1st param comes in... it sounds very much
> like a header size calc is out...
> I dont know... but thats what I'd be looking for...
>
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
> If you cant pay in gold... get lost...
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: "James Wang" <wa...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, October 13, 2008 7:11 AM
Subject: Re: question : encounter java.net.SocketTimeoutException: Read 
timed out occasionally


> Hi Mark,
>
> In order to find out if the problem of Request.getParameter("parm") return
> null (missing post
> body part) is related to http keep-alive,  We've tried to reduce
> the KeepaliveTimeout setting in
> Apache httpd server from 15 seconds to 5 seconds,  the strange thing
> happened, We found
> the null parameter count was raised from 400/per-day (in average) to 900
> times/per-day.
> The next step we are going to disable the keep-alive and see what will
> happen, will let you
> know the result for reference.
>
> If disabling keeplive could resolve this problem, the mysterious part then
> is why the
> the browser get stuck on uploading the post body part always.

James, what is actually doing the post?... Ajax?
Look I dont know, but it smells like a data size problem...
Something like a header size is saying... you going to get 500 bytes and 
only 499 come in... so now the browser is waiting for the stupid server to 
reply, and the server thinks the stupid browser is just slow... eventually 
TCP sockets say... good bye, you guys are just too slow.
So socket time out, I think, is not the real issue... some header size is 
wrong... maybe something subtle like its multibyte and the header size is 
calculating bytes.
If you click twice and then the 1st param comes in... it sounds very much 
like a header size calc is out...
I dont know... but thats what I'd be looking for...

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------
If you cant pay in gold... get lost...




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by James Wang <wa...@gmail.com>.
Hi Mark,

In order to find out if the problem of Request.getParameter("parm") return
null (missing post
body part) is related to http keep-alive,  We've tried to reduce
the KeepaliveTimeout setting in
Apache httpd server from 15 seconds to 5 seconds,  the strange thing
happened, We found
the null parameter count was raised from 400/per-day (in average) to 900
times/per-day.
The next step we are going to disable the keep-alive and see what will
happen, will let you
know the result for reference.

If disabling keeplive could resolve this problem, the mysterious part then
is why the
the browser get stuck on uploading the post body part always.

Thanks.
James Wang.
On Mon, Oct 6, 2008 at 4:39 PM, Mark Thomas <ma...@apache.org> wrote:

> James Wang wrote:
> > Hi Mark,
> >
> > Would like to know if Request.getParameter("parm") return null is related
> to
> > the
> > SocketTimeoutException error, below was my finding that I posted last
> time
> > for
> > your reference .
>
> Unlikely.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by Mark Thomas <ma...@apache.org>.
James Wang wrote:
> Hi Mark,
> 
> Would like to know if Request.getParameter("parm") return null is related to
> the
> SocketTimeoutException error, below was my finding that I posted last time
> for
> your reference .

Unlikely.

Mark



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: question : encounter java.net.SocketTimeoutException: Read timed out occasionally

Posted by James Wang <wa...@gmail.com>.
Hi Mark,

Would like to know if Request.getParameter("parm") return null is related to
the
SocketTimeoutException error, below was my finding that I posted last time
for
your reference .

Thanks.
James.
On Fri, Oct 3, 2008 at 9:50 AM, James Wang <wa...@gmail.com> wrote:

>  Hi Mark,
> We also found sometimes the Request.getparameter("parm") statement was
> return null,
> wondering if it's related to the SocketTimoutException error, So we made a
> minor
> changes on org.apache.catalina.connector.Request.java trying to track what
> the Actual
> Length was from reading the post body part, the result was weird because we
> found
> the Actual Length was either equal to the content-length or zero (whole
> body part was
> missing), would it get back to normal if we disable the keep-alive ?
>
> Following is the changes I made on Request.java for your reference:
>
>   protected void parseParameters() {
>
>     :      :       :      :
>     :      :       :      :
>
>                 if (actualLen == len) {
>                     parameters.processParameters(formData, 0, len);
>                 }
>                 else { // added by me
>                     context.getLogger().error("formData Len error len :" +
> len + " <> actualLen :" + actualLen);
>                 }
>             } catch (Throwable t) {
>                 context.getLogger().warn
>                     (sm.getString("coyoteRequest.parseParameters"), t);
>             }
>         }
>
>     }
>
> Following was the Tomcat log :
>
> SEVERE: formData Len error len :32 <> actualLen :0
> SEVERE: formData Len error len :379 <> actualLen :0
> SEVERE: formData Len error len :32 <> actualLen :0
> SEVERE: formData Len error len :41 <> actualLen :0
> SEVERE: formData Len error len :60 <> actualLen :0
> SEVERE: formData Len error len :74 <> actualLen :0
> SEVERE: formData Len error len :145 <> actualLen :0
> SEVERE: formData Len error len :60 <> actualLen :0
>
> Thanks & Best Regards.
> James Wang
>