RE: [5.5.9] Excessive jk INFO log msgs "connection timeout reached"

2005-10-06 Thread Jean-Marc Marchand
I`m using Tomcat 5.0.30 / Apache 2.0.54 / JK 1.2.14.1

I looked a bit in the source of the Tomcat JK connector,
and the 'connectionTimeout' parameter of the  is
relayed to 'soTimeout' of the listening JK sockets "ChannelSocket.java".
...which takes us to the java.net.Socket api and SO_TIMEOUT parameter.

Seems to me that mod_jk in Apache keeps the connection opened,
therefore never closing it and reusing it for future calls.
If so, and if I set a connectionTimeout on the Tomcat JK connector, it would
always close the connection with a TimeoutException. That would
explain the log entries.

I don't know, I'm just guessing because my system is not in production
yet, but if I set my Tomcat connector to 'no timeout' and my Apache
worker to socket_timeout=30 secs, wouldn't the sockets be recycled on both
ends
anyway when not active for 30 secs?

My Apache workers.properties looks like:

worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.cachesize=150
worker.tomcat1.cache_timeout=600
worker.tomcat1.recycle_timeout=300
worker.tomcat1.socket_timeout=30
worker.tomcat1.socket_keepalive=1

and I haven't had the log entry in Tomcat since I set the
cache and timeouts in Apache.

Hope it helps...
Jean-Marc

> -Original Message-
> From: Rick [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 06, 2005 09:54
> To: 'Tomcat Users List'; [EMAIL PROTECTED]
> Subject: RE: [5.5.9] Excessive jk INFO log msgs "connection timeout
> reached"
>
>
> Jean-Marc,
>   Actually, without the "connectionTimeout" set, jk seems to
> hold on to its
> connections indefinitely and after a while, the apache to
> tomcat connection
> hangs (pages quit serving).   Could you tell me which combo
> of versions you
> use for apache, jk, and tomcat.  I'm trying to figure out what is the
> "correct" configuration.  Or if you have a link to a guide,
> I have yet to
> find a "best practices".
>
> Thanks,
> Rick
>
> -Original Message-
> From: Jean-Marc Marchand [mailto:[EMAIL PROTECTED]
> Posted At: Thursday, October 06, 2005 6:36 AM
> Posted To: Tomcat Dev
> Conversation: [5.5.9] Excessive jk INFO log msgs "connection timeout
> reached"
> Subject: RE: [5.5.9] Excessive jk INFO log msgs "connection
> timeout reached"
>
>
> I got rid of this message when I realized that my AJP connector's
> configuration (in server.xml) had a "connectionTimeout" set.
> Try setting it bigger or simply removing it, which will default to 'no
> timeout'.
>
> Cheers,
> Jean-Marc
>
>
>
> > -Original Message-
> > From: Rick [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, October 05, 2005 18:19
> > To: 'Tomcat Users List'
> > Subject: [5.5.9] Excessive jk INFO log msgs "connection timeout
> > reached"
> >
> >
> > Anyone know the proper way to handle these messages? I get piles of
> > them in catalina.out
> >
> > 
> > Oct 5, 2005 3:00:23 PM org.apache.jk.common.ChannelSocket
> > processConnection
> > INFO: connection timeout reached
> > 
> >
> > Tried adding the following line to the default
> > /common/classes/logging.properties
> > org.apache.jk.common.ChannelSocket.level=WARN
> >
> > Has no effect.  The only thing I have been able to find is people
> > using Log4j instead of the default java.util.logging that
> came setup
> > with Tomcat 5.5.  Was wondering, is that the only way?  If so, why
> > does it work w/ Log4j and not the default java.util.logging?
> >
> > Looking at the source for
> > 'org.apache.jk.common.ChannelSocket', the line reads...
> >
> > log.info( "connection timeout reached");
> >
> > Should it not instead read...
> >
> > if(log.isInfoEnabled()) log.info( "connection timeout reached");
> >
> >
> > Anyway, thanks for any help to this.
> >
> > -Rick Gavin
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [5.5.9] Excessive jk INFO log msgs "connection timeout reached"

2005-10-06 Thread Jean-Marc Marchand
I got rid of this message when I realized that my AJP connector's
configuration (in server.xml) had a "connectionTimeout" set. 
Try setting it bigger or simply removing it, which will default 
to 'no timeout'.

Cheers,
Jean-Marc



> -Original Message-
> From: Rick [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 05, 2005 18:19
> To: 'Tomcat Users List'
> Subject: [5.5.9] Excessive jk INFO log msgs "connection 
> timeout reached"
> 
> 
> Anyone know the proper way to handle these messages? I get 
> piles of them in
> catalina.out
> 
> 
> Oct 5, 2005 3:00:23 PM org.apache.jk.common.ChannelSocket 
> processConnection
> INFO: connection timeout reached
>  
> 
> Tried adding the following line to the default
> /common/classes/logging.properties
> org.apache.jk.common.ChannelSocket.level=WARN
> 
> Has no effect.  The only thing I have been able to find is 
> people using
> Log4j instead of the default java.util.logging that came 
> setup with Tomcat
> 5.5.  Was wondering, is that the only way?  If so, why does 
> it work w/ Log4j
> and not the default java.util.logging?
> 
> Looking at the source for 
> 'org.apache.jk.common.ChannelSocket', the line
> reads...
> 
>   log.info( "connection timeout reached");  
> 
> Should it not instead read...
> 
>   if(log.isInfoEnabled()) log.info( "connection timeout reached");
> 
> 
> Anyway, thanks for any help to this.
> 
> -Rick Gavin
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problems mixin getReader and getParameter

2005-10-05 Thread Jean-Marc Marchand
According to the servlet's spec, the behavior of getParameter()
is undefined if you consumed the payload first through getInputStream 
or getReader:

"If the parameter data was sent in the request body, such as occurs with 
an HTTP POST request, then reading the body directly via .getInputStream or 
.getReader can interfere with the execution of .getParameter method."

Jean-Marc

> -Original Message-
> From: Mauricio Nuñez [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 04, 2005 19:23
> To: Tomcat Users List
> Subject: Problems mixin getReader and getParameter
> 
> 
> Hi all,
> 
> I'm trying the following , with Tomcat 5.5.12 ( Also with 5.0.30 ) , 
> and after reading the request.getReader(), the
> request.getParameter("param") is unusable, returning null.
> 
> I'm trying setting a mark in the BufferedReader, but the 
> result it's the
> same.
> 
> Any hint?
> 
> public void doPost(HttpServletRequest request, 
> HttpServletResponse response)
>   throws ServletException, IOException
> {
> 
>   String line=null;
>   BufferedReader br = request.getReader();
>   br.mark(4096);
>   while((line=br.readLine())!=null)
>   {
>   System.out.println("TBK:"+line);
>   }
>   br.reset();
>   request.getRequestDispatcher("close").forward(request,response);
> }
> 
> TIA
> 
> Mauricio Nuñez
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]