Tomcat error messages sent to client browsesr

2009-02-24 Thread Edao, Aliye
Dear all,
 
I am trying to find out if there is an alternative way of telling Tomcat
not to send information to the client browser in a 
case of an error (Stack trace, Root Cause ...) in the application rather
than by defining an error-page in web.xml.
 
 
System information:
 
+++
Linux 2.6.5-7.283-bigsmp
Tomcat 6.0.18
Apache 2.0.63
Java jdk1.6.0 (jre)
+++
 
Error message displayed in client browser:
 
HTTP Status 500 - 


type Exception report
 
message 
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception 

Stacktrace:
 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWrapper.java:505)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:416)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
de.netbank.tools.persistence.HibernateFilter.doFilter(HibernateFilter.ja
va:43)
 
de.netbank.tools.tracking.TrackingFilter.doFilter(TrackingFilter.java:16
1)
 de.netbank.tools.CharsetFilter.doFilter(CharsetFilter.java:47)
 de.netbank.tools.XSSFilter.doFilter(XSSFilter.java:47)
 
root cause 
 
java.lang.ArrayIndexOutOfBoundsException: 1
 
de.netbank.tools.fonds.FondsShopBean.parseWarenkorb(FondsShopBean.java:4
67)
 
org.apache.jsp.fondsshop_005fanlagebetrag_jsp._jspService(fondsshop_005f
anlagebetrag_jsp.java:533)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:374)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
de.netbank.tools.persistence.HibernateFilter.doFilter(HibernateFilter.ja
va:43)
 
de.netbank.tools.tracking.TrackingFilter.doFilter(TrackingFilter.java:16
1)
 de.netbank.tools.CharsetFilter.doFilter(CharsetFilter.java:47)
 de.netbank.tools.XSSFilter.doFilter(XSSFilter.java:47)
 
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.18 logs.


 
Apache Tomcat/6.0.18
 
+++
 
Solution I already implemented in web.xml:
 

java.lang.Exception
/page_not_foung.jsp

 

500
/page_not_foung.jsp


 
The above solution works fine. But what I am trying to find out is - if
there is a way to tell Tomcat not to send 
error messages and Version Information to the client browser with out
using the above mentioned error-page.
 
Is this possible? If yes - I will be very thankful for any hint!
 
 
With best regards,
 
Aliye
 

 
 


RE: tomcat webapp FORM authentication problem

2009-02-24 Thread Caldarale, Charles R
> From: Alexander Soudackov [mailto:so...@chem.psu.edu]
> Subject: tomcat webapp FORM authentication problem
>
> I have a very annoying problem with a secured folder
> in my tomcat web application.

You could start the problem description by telling us the version of Tomcat 
you're using.  It's likely not pertinent for this particular issue, but it's 
annoying to hide such information.

> The problem #1 is: login.html displays a form BUT there
> is NO images, NO CSS formatting, and Javascript!

Think about it: you've declared the resources noted as being protected, 
authentication has not occurred, yet somehow you're expecting Tomcat to 
magically ignore the protection settings when the browser requests these 
resources?  You can't have it both ways - you need to place the resources the 
form needs outside of the protected area.

> The problem #2 is: after successful authentication the
> browser shows the SOURCE of the first javascript referenced
> in index.html, instead of index.html

Try fixing the first problem and see if the second one disappears.

> The problems reoccur after cleaning the cash and cookies of
> the browser.

You robbed your browser?  Or did you clean out its cache?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



tomcat webapp FORM authentication problem

2009-02-24 Thread Alexander Soudackov

Hi everybody,

I have a very annoying problem with a secured folder in my tomcat web 
application. The most amazing is that the problems do not occur when I'm 
using BASIC authentication, but only when FORM authentication. Here is 
what I have configured (mywebapp is the name of the folder with my web 
application, this folder is in ${TOMCAT}/webapps; protectedarea is the 
name of the protected folder):


- JDBCRealm is configured in server.xml (tested, working properly);

- security-constrained configured in 
${TOMCAT}/webapps/mywebapp/WEB-INF/web.xml :


 

   mywebapp Security Constraint 



  mywebapp 

  /protectedarea/* 

  DELETE 

  GET 

  POST 

  PUT 





  tomcat 



 

 

   FORM 

   mywebapp Application 



  /protectedarea/login.html 

  /protectedarea/error.html 



 



- login.html has the following login form (stripped of formatting here 
for clarity):



E-mail address: 
Password:   
 




- I also have subdirectories (with images, javascripts, css) in 
mywebapp/protectedarea. The html files in protectedarea (index.html, 
login.html, and error.html) refer to the contents of these 
subdirectories when loading javascripts, css, and images.


NOW,

The problem #1 is: login.html displays a form BUT there is NO images, NO 
CSS formatting, and Javascript! The page displays just a raw form.


The problem #2 is: after successful authentication the browser shows the 
SOURCE of the first javascript referenced in index.html, instead of 
index.html. The strangest thing is that after reloading the page 
(index.html) everything displays fine, including the login.html.


The problems reoccur after cleaning the cash and cookies of the browser. 
It looks like there is a temporary problem with context which gets 
resolved somehow after the first login attempt.


Please, could somebody give me some advise/explanation, I have NO IDEA 
what is happening. Again, the BASIC authentication works fine, but I 
don't like this pop-up window and would like to use my own login form.


Thanks a lot,
Alex


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



Re: mod_jk

2009-02-24 Thread ilndinesh

> But if you have only one Tomcat to send requests to, then all this tells 
you is that this Tomcat is not responding.  So now what do you do ?

  In this case, I want apache to treat the request as DECLINED by mod_jk, so
that if we put some static content in apache at this place, it will be
served at least until tomcat is ready again.
  Which means, if we can test tomcat's availability before sending it the
actual request, we can DECLINE the request if necessary, and thereby apache
will serve it if it can.


awarnier wrote:
> 
> Mohit Anchlia wrote:
>> Sorry I am little confused about couple of things:
>> 
>> 1. Based on what I read it looks like workers.properties is not loaded
>> dynamically. And JkMountFileReload doesn't work for worker.properties
>> but it works for uriworkermap.properties.
> Correct, that is what was said.
> In clear it means that you can to a certain extent dynamically change 
> the URI's that will be redirected to Tomcat, but you cannot change the 
> kind of properties that are in workers.properties (the address of the 
> back-end Tomcats etc..)
> 
>> 2. Wouldn't setting prepost timeout ensure that a check is made to see
>> if remote machine is up before forwarding the request?
> Yes.
> But if you have only one Tomcat to send requests to, then all this tells 
> you is that this Tomcat is not responding.  So now what do you do ?
> 
> I'll use an image : finding out that the back-end Tomcat does not even 
> respond to a ping, rather than sending the whole request and getting an 
> error then (which is more time-consuming), is a way to know faster that 
> there is a problem.  But you still have this hot client request in your 
> lap, so now what do you do with it ?
> If you have 2 or more Tomcats, then it really helps, because mod_jk can 
> redirect the request to a Tomcat which still works.  But if there is 
> only one anyway, you're cooked.
> 
> 
>> On Fri, Feb 6, 2009 at 11:01 AM, fredk2  wrote:
>>> Hi Rainer,
>>>
>>> your comment about the watchdog sounds interesting.  When you load
>>> balance
>>> it would seem useful to get feedback from Tomcat itself about its load
>>> so
>>> that the module can adjust dynamically its load (lbfactor) based on the
>>> Tomcat's performance rather than a session/socket count. One can wonder
>>> if
>>> such added complexity would be detrimental to the mod_jk stability.
>>>
>>> Rgds - Fred
>>>
>>>
>>> Rainer Jung-3 wrote:
 On 06.02.2009 18:23, André Warnier wrote:
> gerhardus.geldenh...@gta-travel.com wrote:
>>> 1) As far as I know, no, mod_jk does not read workers.properties
>>> dynamically.
>>> 2) Yes and no, it will not send a request unless communication has
>> been
>>> established with the worker, it may happen that the worker fails, or
>>> someone shut it down. Depending on how you configure the workers and
>>> the
>>> number of workers, it can retry the request and/or try a different
>>> worker. Mod_jk will mark the worker on error when it does not
>>> respond,
>>> and it will try again after a configurable time -but it tries again
>>> with
>>> an actual request-.
>>>
>> It would be really nice if you could test availability of a node with
>> a
>> configurable request instead of a live production request... (hint,
>> hint)
>>
> Isn't that what "ping" is about ?
 Ping tests, whether there is something able to still process AJP on the
 other side of the connection. A configurable request would be able to
 talk to the application, so one could detect, whether it is still
 deployed, and if the request would be handled by an intelligent servlet
 it could respond with some sort of application layer health status.

 Worth filing an enhancement request, since Mladen put the Watchdog
 thread into 1.2.27, we can easily add more logic of that type.

 Regards,

 Rainer

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



>>> --
>>> View this message in context:
>>> http://www.nabble.com/mod_jk-tp21856049p21878692.html
>>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in conte

Re: mod_jk

2009-02-24 Thread ilndinesh

> But if you have only one Tomcat to send requests to, then all this tells 
you is that this Tomcat is not responding.  So now what do you do ?

  In this case, I want apache to treat the request as DECLINED by mod_jk, so
that if we put some static content in apache at this place, it will be
served at least until tomcat is ready again.
  Which means, if we can test tomcat's availability before sending it the
actual request, we can DECLINE the request if necessary, and thereby apache
will serve it if it can.


awarnier wrote:
> 
> Mohit Anchlia wrote:
>> Sorry I am little confused about couple of things:
>> 
>> 1. Based on what I read it looks like workers.properties is not loaded
>> dynamically. And JkMountFileReload doesn't work for worker.properties
>> but it works for uriworkermap.properties.
> Correct, that is what was said.
> In clear it means that you can to a certain extent dynamically change 
> the URI's that will be redirected to Tomcat, but you cannot change the 
> kind of properties that are in workers.properties (the address of the 
> back-end Tomcats etc..)
> 
>> 2. Wouldn't setting prepost timeout ensure that a check is made to see
>> if remote machine is up before forwarding the request?
> Yes.
> But if you have only one Tomcat to send requests to, then all this tells 
> you is that this Tomcat is not responding.  So now what do you do ?
> 
> I'll use an image : finding out that the back-end Tomcat does not even 
> respond to a ping, rather than sending the whole request and getting an 
> error then (which is more time-consuming), is a way to know faster that 
> there is a problem.  But you still have this hot client request in your 
> lap, so now what do you do with it ?
> If you have 2 or more Tomcats, then it really helps, because mod_jk can 
> redirect the request to a Tomcat which still works.  But if there is 
> only one anyway, you're cooked.
> 
> 
>> On Fri, Feb 6, 2009 at 11:01 AM, fredk2  wrote:
>>> Hi Rainer,
>>>
>>> your comment about the watchdog sounds interesting.  When you load
>>> balance
>>> it would seem useful to get feedback from Tomcat itself about its load
>>> so
>>> that the module can adjust dynamically its load (lbfactor) based on the
>>> Tomcat's performance rather than a session/socket count. One can wonder
>>> if
>>> such added complexity would be detrimental to the mod_jk stability.
>>>
>>> Rgds - Fred
>>>
>>>
>>> Rainer Jung-3 wrote:
 On 06.02.2009 18:23, André Warnier wrote:
> gerhardus.geldenh...@gta-travel.com wrote:
>>> 1) As far as I know, no, mod_jk does not read workers.properties
>>> dynamically.
>>> 2) Yes and no, it will not send a request unless communication has
>> been
>>> established with the worker, it may happen that the worker fails, or
>>> someone shut it down. Depending on how you configure the workers and
>>> the
>>> number of workers, it can retry the request and/or try a different
>>> worker. Mod_jk will mark the worker on error when it does not
>>> respond,
>>> and it will try again after a configurable time -but it tries again
>>> with
>>> an actual request-.
>>>
>> It would be really nice if you could test availability of a node with
>> a
>> configurable request instead of a live production request... (hint,
>> hint)
>>
> Isn't that what "ping" is about ?
 Ping tests, whether there is something able to still process AJP on the
 other side of the connection. A configurable request would be able to
 talk to the application, so one could detect, whether it is still
 deployed, and if the request would be handled by an intelligent servlet
 it could respond with some sort of application layer health status.

 Worth filing an enhancement request, since Mladen put the Watchdog
 thread into 1.2.27, we can easily add more logic of that type.

 Regards,

 Rainer

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



>>> --
>>> View this message in context:
>>> http://www.nabble.com/mod_jk-tp21856049p21878692.html
>>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in conte

Re: mod_jk not working as expected - is there a bug??

2009-02-24 Thread Mohit Anchlia
In httpd conf I just see JkMount and no other directive. I searched for Jk.

Here is workers.properties file:
##
worker.list=status,tc

## Worker Configuration##

# All entries in this section take the form:
#   worker..=
# Worker names are defined in the worker.list directive above.


# Configuration specifying the worker named "status" as a status worker.
# This worker can be used to administer the other configured workers.
worker.status.type=status


# Configuration for the default load balancer worker.
# Uncomment the configuration for the "tc"
# worker, and the two "node" workers below to enable.
# Also add "lb" to the workers.list directive
# above.  The default  for the load balancer worker is
# round-robin distribution of requests over
# all active nodes.  There are currently two nodes set
# up for the load balanced worker, add more
# to this list if required.  Sticky sessions is defaulted to true.
worker.tc.type=lb
worker.tc.balance_workers=appfe1,appfe2,appfe3,appfe4
worker.tc.sticky_session=true


# Two load balanced workers, called node1 and node2.
# Copy the configurations and add to the
#   worker.tc.balanced_workers
# list above to add more nodes to the Tomcat cluster.


# appfe1
worker.appfe1.type=ajp13
worker.appfe1.port=8009
worker.appfe1.host=appfe1
worker.appfe1.socket_timeout=5
worker.appfe1.socket_keepalive=true
worker.appfe1.prepost_timeout=5
worker.appfe1.connect_timeout=5000
worker.appfe1.retries=3
worker.appfe1.recycle_timeout=900

# Refererence BHP Apache tuning guide before uncomment the following
line. The unit of reply_timeout is millisecond.
#worker.appfe1.reply_timeout=0

# appfe2
worker.appfe2.type=ajp13
worker.appfe2.port=8009
worker.appfe2.host=appfe2
worker.appfe2.socket_timeout=5
worker.appfe2.socket_keepalive=true
worker.appfe2.prepost_timeout=5
worker.appfe2.connect_timeout=5000
worker.appfe2.retries=3
worker.appfe2.recycle_timeout=900

# Refererence BHP Apache tuning guide before uncomment the following
line. The unit of reply_timeout is millisecond.
#worker.appfe2.reply_timeout=0

# appfe3
worker.appfe3.type=ajp13
worker.appfe3.port=8009
worker.appfe3.host=appfe3
worker.appfe3.socket_timeout=5
worker.appfe3.socket_keepalive=true
worker.appfe3.prepost_timeout=5
worker.appfe3.connect_timeout=5000
worker.appfe3.retries=3
worker.appfe3.recycle_timeout=900

# Refererence BHP Apache tuning guide before uncomment the following
line. The unit of reply_timeout is millisecond.
#worker.appfe3.reply_timeout=0

# appfe4
worker.appfe4.type=ajp13
worker.appfe4.port=8009
worker.appfe4.host=appfe4
worker.appfe4.socket_timeout=5
worker.appfe4.socket_keepalive=true
worker.appfe4.prepost_timeout=5
worker.appfe4.connect_timeout=5000
worker.appfe4.retries=3
worker.appfe4.recycle_timeout=900

# Refererence BHP Apache tuning guide before uncomment the following
line. The unit of reply_timeout is millisecond.
#worker.appfe4.reply_timeout=0

On Tue, Feb 24, 2009 at 4:50 PM, Rainer Jung  wrote:
> On 25.02.2009 00:00, Mohit Anchlia wrote:
>>
>> Reposting:
>>
>> Apache Server - 2.2
>> Tomcat server 6
>> Jboss - 4.2
>>
>> We have Web Servers talking to Jboss App Servers over mod_jk. When we
>> do our patch or upgrade of software we do it in rolling fashion so
>> that there is "0" customer impact. But it looks like mod_jk load
>> balancer on Web server doesn't detect it as soon as Jboss App Server
>> goes down. Our goal is to have 0 customer impact. So my question is
>> what can we do to overcome this problem. Web Server sees Http Error
>> Code 503.
>>
>> Information from log file:
>>
>> [Mon Feb 23 13:39:42.146 2009] [31682:4143745888] [error]
>> ajp_connection_tcp_get_message::jk_ajp_common.c (966): (appfe4) can't
>> receive the response message from tomcat, network problems or tomcat
>> (10.10.81.89:8009) is down (errno=104)
>> [Mon Feb 23 13:39:42.147 2009] [31682:4143745888] [error]
>> ajp_service::jk_ajp_common.c (2097): (appfe4) Connecting to tomcat
>> failed. Tomcat is probably not started or is listening on the wrong
>> port
>
> This means that mod_jk detected that your backend is down and thus puts it
> into an error state. All following requests will no longer be sent to this
> backend. Once a minute it will send a request there and try, but as long as
> it is down this test will not succeed and thus all requests will be sent to
> other nodes.
>
> The first request that gets sent to the backend you stopped might get an
> error back. If you want to prevent that from happening, use Cping/Cpong:
>
> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html
>
> so we will detect the broken node before actually sending a request there.
> More details are not possible to give without your JK configuration (Jk
> directive sin httpd configuration files, workers.properties and if used
> uriworkermap.properties).
>
> The line number of the above message tells me you are using mod_jk 1.2.25.
> Although there's nothing wrong in principal with 1.2.25, we always try to
> improve an

Re: mod_jk not working as expected - is there a bug??

2009-02-24 Thread Rainer Jung

On 25.02.2009 00:00, Mohit Anchlia wrote:

Reposting:

Apache Server - 2.2
Tomcat server 6
Jboss - 4.2

We have Web Servers talking to Jboss App Servers over mod_jk. When we
do our patch or upgrade of software we do it in rolling fashion so
that there is "0" customer impact. But it looks like mod_jk load
balancer on Web server doesn't detect it as soon as Jboss App Server
goes down. Our goal is to have 0 customer impact. So my question is
what can we do to overcome this problem. Web Server sees Http Error
Code 503.

Information from log file:

[Mon Feb 23 13:39:42.146 2009] [31682:4143745888] [error]
ajp_connection_tcp_get_message::jk_ajp_common.c (966): (appfe4) can't
receive the response message from tomcat, network problems or tomcat
(10.10.81.89:8009) is down (errno=104)
[Mon Feb 23 13:39:42.147 2009] [31682:4143745888] [error]
ajp_service::jk_ajp_common.c (2097): (appfe4) Connecting to tomcat
failed. Tomcat is probably not started or is listening on the wrong
port


This means that mod_jk detected that your backend is down and thus puts 
it into an error state. All following requests will no longer be sent to 
this backend. Once a minute it will send a request there and try, but as 
long as it is down this test will not succeed and thus all requests will 
be sent to other nodes.


The first request that gets sent to the backend you stopped might get an 
error back. If you want to prevent that from happening, use Cping/Cpong:


http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html

so we will detect the broken node before actually sending a request 
there. More details are not possible to give without your JK 
configuration (Jk directive sin httpd configuration files, 
workers.properties and if used uriworkermap.properties).


The line number of the above message tells me you are using mod_jk 
1.2.25. Although there's nothing wrong in principal with 1.2.25, we 
always try to improve and you might consider switching to 1.2.27.


You should also increase your JkLogLevel to info. As long as only 
occasional info messages are in your log file everything is fine, but 
once error messages show up, the additional info messages contain useful 
formation.


Regards,

Rainer

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



Re: Apache -> Tomcat connection problem

2009-02-24 Thread Rainer Jung

On 24.02.2009 23:31, Daryl Stultz wrote:

  Tomcat AJP connector defaults to 200 for maxThreads. The site has 20
Defaults? I think no, and you haven't configured 200 in your abive config
snippet.



See Christopher's response. Do you know of the implementation being
different than the docs?


No, he's right, but the sizing of the thread pool is so important that I 
wouldn't only rely on the default. You always have to remember that and 
it might change during upgrading or when switching to a different 
connector implementation.



First check, whether it is really ESTABISHED connections. Then configure
reasonable timeouts as described in the mod_proxy documentation and an
additional connectionTimeout for Tomcat.



This is the part where expert advice comes in. I don't have any idea what
"reasonable timeouts" are and the docs don't give a decent way to calculate
it.


My personal opinion:

min Default 0 is fine.

max Default 1 is fine for prefork MPM (single threaded)

smaxEither 0 or 1. I would say 0 in order to get rid of idle connections.

acquire Should be irrelevant for prefork.

connectiontimeout E.g. 5 or 10

pingI would activate this with a value of e.g. 10 (seconds)

ttl 	E.g. 600 (seconds). You should then set connectionTimeout on your 
Tomcat connector to 60 (milliseconds).


timeout Setting a timeout generally would make things more robust, but 
you need to make sure, that nothing in your webapp responds slower than 
this value (seconds).


Regards,

Rainer

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



Re: apache tomcat connector header size

2009-02-24 Thread eric tse
Thank you very much

On Tue, Feb 24, 2009 at 2:59 PM, Rainer Jung  wrote:
> On 19.02.2009 21:54, eric tse wrote:
>>
>> which Apache/Tomcat connector are you talking about ?
>>
>> isapi_redirect.dll (1.2.14.0)
>>
>> The official site is
>> http://tomcat.apache.org/connectors-doc/
>>
>> what versions of Apache, Tomcat, and the connector ?
>>
>> Proxy on IIS6 windows 2K3, tomcat backend (6.0.18) on solaris 10
>>
>> on what platform ?
>>
>>
>> You know may proxy server has reverse proxy header size that we can
>> tune up. I can't find it in the official doc in this plugin. I don't
>> know if you guys can give me a hand.
>
> Look at the description of max_packet_size on
>
> http://tomcat.apache.org/connectors-doc/reference/workers.html
>
> Please note especially the info on versions and the necessity to add some
> Tomcat configuration to.
>
> Regards,
>
> Rainer
>
>> On Wed, Feb 4, 2009 at 1:33 AM, André Warnier  wrote:
>>>
>>> Eric,
>>>
>>> I'll answer this, so that you don't feel like being totally ignored,
>>> which
>>> should really be the case.
>>>
>>> If you really want an answer however, I suggest you repost with some
>>> additional information :
>>> - which Apache/Tomcat connector are you talking about ?
>>> - what versions of Apache, Tomcat, and the connector ?
>>> - on what platform ?
>>>
>>> and can you also try to be a bit more specific about what your problem is
>>> ?
>>> Oh, and don't be afraid to include apparently irrelevant details such as
>>> what "headers" you are talking about, how big, when, how, the original
>>> error
>>> message and where it comes from etc..
>>>
>>>
>>>
>>>
>>> eric tse wrote:

 how can I bump up the header size of connector?

> apache tomcat connector header ???
>
> How?
>
> I think I am trying to a big header transfer .. and it breaks in proxy
> point,
> saying fail to append header. and did route
>
> Thanks
>
> Eric Tse

 On Tue, Feb 3, 2009 at 2:08 PM, eric tse  wrote:
>
> Can I bump up the header size of the
>
> apache tomcat connector header ???
>
> How?
>
> I think I am trying to a big header transfer .. and it breaks in proxy
> point,
> saying fail to append header. and did route
>
> Thanks
>
> Eric Tse
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

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



mod_jk not working as expected - is there a bug??

2009-02-24 Thread Mohit Anchlia
Reposting:

Apache Server - 2.2
Tomcat server 6
Jboss - 4.2

We have Web Servers talking to Jboss App Servers over mod_jk. When we
do our patch or upgrade of software we do it in rolling fashion so
that there is "0" customer impact. But it looks like mod_jk load
balancer on Web server doesn't detect it as soon as Jboss App Server
goes down. Our goal is to have 0 customer impact. So my question is
what can we do to overcome this problem. Web Server sees Http Error
Code 503.

Information from log file:

[Mon Feb 23 13:39:42.146 2009] [31682:4143745888] [error]
ajp_connection_tcp_get_message::jk_ajp_common.c (966): (appfe4) can't
receive the response message from tomcat, network problems or tomcat
(10.10.81.89:8009) is down (errno=104)
[Mon Feb 23 13:39:42.147 2009] [31682:4143745888] [error]
ajp_service::jk_ajp_common.c (2097): (appfe4) Connecting to tomcat
failed. Tomcat is probably not started or is listening on the wrong
port


On Tue, Feb 24, 2009 at 1:41 PM, Rainer Jung  wrote:
> On 24.02.2009 19:18, Mohit Anchlia wrote:
>>
>> We have Web Servers talking to Jboss App Servers over mod_jk. When we
>> do our patch or upgrade of software we do it in rolling fashion so
>> that there is "0" customer impact. But it looks like mod_jk load
>> balancer on Web server doesn't detect it as soon as Jboss App Server
>> goes down. Our goal is to have 0 customer impact. So my question is
>> what can we do to overcome this problem. Web Server sees Http Error
>> Code 503.
>
> No configuration, no version information, no log files: not much we can help
> with.
>
> Also: your message subject is not likely to attract helping people.
>
> Sorry,
>
> Rainer
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

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



Re: Apache -> Tomcat connection problem

2009-02-24 Thread Daryl Stultz
On Tue, Feb 24, 2009 at 4:56 PM, Rainer Jung wrote:

> You need to understand it.
> ...
> You can check your MPM by calling "httpd -V". The output will contain a
> line like
>
>  -D APACHE_MPM_DIR="server/mpm/worker"
>

Server version: Apache/2.2.2
Server built:   Jul 26 2006 11:12:08
Server's Module Magic Number: 20051115:2
Server loaded:  APR 1.2.2, APR-Util 1.2.7
Compiled using: APR 1.2.2, APR-Util 1.2.7
Architecture:   32-bit
Server MPM: Prefork
  threaded: no
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"


>
>  Tomcat AJP connector defaults to 200 for maxThreads. The site has 20
>>
>
> Defaults? I think no, and you haven't configured 200 in your abive config
> snippet.
>

See Christopher's response. Do you know of the implementation being
different than the docs?

>
>
>  applications, each with 2 ProxyPass directives for ports 80 and 443. The
>>
>
> Hmm, not sure, how ports 80 and 443 with HTTP(s) proxying come into play
> now.
>

Me neither, just trying to provide useful setup information. I have a total
of about 40 ProxyPass (mod_proxy_ajp) directives. I don't have any idea how
that impacts things.

>
> What's you platform?


Fedora Core release 5 (Bordeaux)


>
> The command counts LISTEN (the listening socket), the 2 header lines, all
> ESTABLISHED connections (those are the ones you are after) and e.g. also
> TIME_WAIT connections, all of them together. You need to count more
> specific.
>

Yes, I mentally accounted for the header lines. Leaving off the wc -l, I
have never seen anything but ESTABLISHED. I'll keep an eye on it.

>
> Consider upgrading httpd to 2.2.11, because mod_proxy_ajp was very new in
> 2.2.2 and there have been a couple of fixes after that version.
>

I'll look into that.


> First check, whether it is really ESTABISHED connections. Then configure
> reasonable timeouts as described in the mod_proxy documentation and an
> additional connectionTimeout for Tomcat.
>

This is the part where expert advice comes in. I don't have any idea what
"reasonable timeouts" are and the docs don't give a decent way to calculate
it.

Thanks.

-- 
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com


RE: Problem with sessions on a fedora 10 machine

2009-02-24 Thread Noam Aigerman
Hi Chris, 
I managed to isolate the issue - you were close with your last guess :) - in 
proxy_ajp.conf I mapped my webapp by doing:
ProxyPass / ajp://localhost:8009/Noam
So whoever comes to my site can go to www.site.com and not www.site.com/Noam
I am guessing the cookies are set to a wrong domain. What should I do? And is 
this kind of mapping the wrong way to do it in the first place?
Thanks, Noam

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Wednesday, February 25, 2009 12:01 AM
To: Tomcat Users List
Subject: Re: Problem with sessions on a fedora 10 machine

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Noam,

On 2/24/2009 2:06 PM, Noam Aigerman wrote:
> I've been working with apache tomcat under windows for a few months now.
> I've just setup a new fedora server, and deployed a .war file to it's
> webapps directory.
> Everything is running fine on the fedora machine, except that the
> session doesn't seem to "stick".
> doing something like the code below in my Servlet:
> 
> String check=session.getAttribute("check");
> System.out.println("this is what I got: "+ check);
> session.setAttribute("check","one");

How do you acquire the session object in the first place?

Are you using cookies or URL rewriting? Have you done an HTTP capture
using LiveHttpHeaders (or similar) or a TCP dump using Wireshark (or
similar)?

I wonder if the cookie is being set to a domain like www.foo.com but
your are using 'localhost' to access the webapp. This will cause your
browser to fail to send cookies back to the server on subsequent requests.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmkbgUACgkQ9CaO5/Lv0PDXUwCfUVCeAWe7S4JlBlIYqGhx57kC
0XEAoLXpxrcTD5tNb4YpPXjVBZG5JaNa
=PGmv
-END PGP SIGNATURE-

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




Re: Apache -> Tomcat connection problem

2009-02-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

On 2/24/2009 4:56 PM, Rainer Jung wrote:
> On 24.02.2009 21:50, Daryl Stultz wrote:
>> Tomcat AJP connector defaults to 200 for maxThreads. The site has 20
> 
> Defaults? I think no, and you haven't configured 200 in your abive
> config snippet.

Maybe there is no default, but it is sure documented as such:
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
Docs for 'maxThreads' attribute:

"
The maximum number of request processing threads to be created by this
Connector, which therefore determines the maximum number of simultaneous
requests that can be handled. If not specified, this attribute is set to
200.
"

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmkbzYACgkQ9CaO5/Lv0PDXxgCgoxfcryiulllcC1AsSZYbS0ZJ
r1gAnjJCWj45D0Yot5sGCLa6ZnUtto3k
=RM2B
-END PGP SIGNATURE-

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



Re: apache tomcat connector header size

2009-02-24 Thread Rainer Jung

On 19.02.2009 21:54, eric tse wrote:

which Apache/Tomcat connector are you talking about ?

isapi_redirect.dll (1.2.14.0)

The official site is
http://tomcat.apache.org/connectors-doc/

what versions of Apache, Tomcat, and the connector ?

Proxy on IIS6 windows 2K3, tomcat backend (6.0.18) on solaris 10

on what platform ?


You know may proxy server has reverse proxy header size that we can
tune up. I can't find it in the official doc in this plugin. I don't
know if you guys can give me a hand.


Look at the description of max_packet_size on

http://tomcat.apache.org/connectors-doc/reference/workers.html

Please note especially the info on versions and the necessity to add 
some Tomcat configuration to.


Regards,

Rainer


On Wed, Feb 4, 2009 at 1:33 AM, André Warnier  wrote:

Eric,

I'll answer this, so that you don't feel like being totally ignored, which
should really be the case.

If you really want an answer however, I suggest you repost with some
additional information :
- which Apache/Tomcat connector are you talking about ?
- what versions of Apache, Tomcat, and the connector ?
- on what platform ?

and can you also try to be a bit more specific about what your problem is ?
Oh, and don't be afraid to include apparently irrelevant details such as
what "headers" you are talking about, how big, when, how, the original error
message and where it comes from etc..




eric tse wrote:

how can I bump up the header size of connector?


apache tomcat connector header ???

How?

I think I am trying to a big header transfer .. and it breaks in proxy
point,
saying fail to append header. and did route

Thanks

Eric Tse

On Tue, Feb 3, 2009 at 2:08 PM, eric tse  wrote:

Can I bump up the header size of the

apache tomcat connector header ???

How?

I think I am trying to a big header transfer .. and it breaks in proxy
point,
saying fail to append header. and did route

Thanks

Eric Tse


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



Re: Problem with sessions on a fedora 10 machine

2009-02-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Noam,

On 2/24/2009 2:06 PM, Noam Aigerman wrote:
> I've been working with apache tomcat under windows for a few months now.
> I've just setup a new fedora server, and deployed a .war file to it's
> webapps directory.
> Everything is running fine on the fedora machine, except that the
> session doesn't seem to "stick".
> doing something like the code below in my Servlet:
> 
> String check=session.getAttribute("check");
> System.out.println("this is what I got: "+ check);
> session.setAttribute("check","one");

How do you acquire the session object in the first place?

Are you using cookies or URL rewriting? Have you done an HTTP capture
using LiveHttpHeaders (or similar) or a TCP dump using Wireshark (or
similar)?

I wonder if the cookie is being set to a domain like www.foo.com but
your are using 'localhost' to access the webapp. This will cause your
browser to fail to send cookies back to the server on subsequent requests.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmkbgUACgkQ9CaO5/Lv0PDXUwCfUVCeAWe7S4JlBlIYqGhx57kC
0XEAoLXpxrcTD5tNb4YpPXjVBZG5JaNa
=PGmv
-END PGP SIGNATURE-

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



Re: Apache -> Tomcat connection problem

2009-02-24 Thread Rainer Jung

On 24.02.2009 21:50, Daryl Stultz wrote:

I'm running Tomcat 5.5.17 behind Apache 2.2.2. I am connecting with a Tomcat
AJP connector like so:

  

and Apache ProxyPass like so:

ProxyPass /myapp ajp://localhost:8009/myapp/

Apache has the default number of connections set - MaxClients is either 256
or 150, I don't understand the prefork/worker MPM thing. As above, the


You need to understand it.

prefork MPM: only uses processes, not multiple threads per process. Each 
request being processed occupies one process. Each process can only 
handle one rquest at a time. Scaling up and down via creating additional 
processes or stopping idle ones.


worker MPM: Uses multi-threaded processes, each with the same number of 
(configured) threads, by default 25. Each request being processed 
occupies one thread, each process can handle multiple threads 
concurrently (as many as you configured threads per process). Scaling up 
and down via creating additional processes or stopping idle ones.


winnt MPM: Only on windows. Uses two processes, one is a watchdog (it 
does also exist for prefork and worker) and the other one is highly 
multithreaded (default 150 threads) and does all the requests. Like 
worker with one fixed worker process using much more threads in this 
process. No scaling up and down.


You can check your MPM by calling "httpd -V". The output will contain a 
line like


 -D APACHE_MPM_DIR="server/mpm/worker"


Tomcat AJP connector defaults to 200 for maxThreads. The site has 20


Defaults? I think no, and you haven't configured 200 in your abive 
config snippet.



applications, each with 2 ProxyPass directives for ports 80 and 443. The


Hmm, not sure, how ports 80 and 443 with HTTP(s) proxying come into play 
now.



general load on the site is low with 5 - 15 users on at any one time.

This command here, I believe, counts the number of connections between
Apache and Tomcat:

netstat -tn | sed -n -e| wc -l


What's you platform?

The command counts LISTEN (the listening socket), the 2 header lines, 
all ESTABLISHED connections (those are the ones you are after) and e.g. 
also TIME_WAIT connections, all of them together. You need to count more 
specific.


Depending on your idle timeouts on the AJP connections, you might have 
many more TIME_WAITs than ESTABLISHED. For the idle timeouts, see the 
mod_proxy docs page for httpd and connectionTimeout for the Tomcat AJP 
connector. Consider upgrading httpd to 2.2.11, because mod_proxy_ajp was 
very new in 2.2.2 and there have been a couple of fixes after that version.



The site has been running for a couple years, though the code changes and I
continue to add new apps, it has been running fine. Now what seems to be
happening is the number of connections between Apache and Tomcat grows at
various rates from 4 or 10 or 20 after an Apache restart to 400 and more. At
around 400 the site gets very sluggish. This seems to make some sense if
Tomcat has maxThreads of 200 and the above command counts connections in
both directions - TC is running out of connections. The question is why? I
don't have enough users to warrant the connection pool growing like this. I
currently have a cron task that does a graceful restart of Apache after 300
connections. Can anyone shed some light on this or point me to some other
resource for help?


First check, whether it is really ESTABISHED connections. Then configure 
reasonable timeouts as described in the mod_proxy documentation and an 
additional connectionTimeout for Tomcat.


Regards,

Rainer

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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sam,

On 2/24/2009 1:54 PM, Sam Hokin wrote:
> Mark Thomas wrote:
>> Sam Hokin wrote:
>>> Thanks, Chris.  I ran e2fsck with the -c option, which runs badblocks,
>>> when I tested it earlier.  And I just ran badblocks again - 0 bad blocks
>>> found.  I wish I could fix this by simply as swapping out a bad disk
>>> (notwithstanding Andre's desire for intellectual pursuits), but I really
>>> think it's software, either in some service mucking up the JVM or the
>>> JVM itself.  But it only manifests itself under Tomcat, and then only
>>> when this particular package is imported.
>>
>> Do you see the same issue if you pre-compile that JSP?
> 
> Surprisingly, yes.  So it's not only a compilation issue.  After some
> individual tests, I compiled the JSPs from the four sites I have running
> on this server and restarted Tomcat, and the LONG delay before Tomcat
> begins serving page requests continues.

... and what is happening when you take a thread dump. Is it
File.exists() taking forever again? If that's the case, the class
loading is what's taking forever. I have no idea what could be causing
that other than a disk read error (or network latency, but you mentioned
you weren't using NFS or anything like that).

Someone mentioned running strace which sounds like a good idea to me.
You'll just have to sift through a ton of information to find what
you're looking for since the JVM performs a /lot/ of system calls during
its operation.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmkbIoACgkQ9CaO5/Lv0PAHFQCeKMwKXF3xU655W54unmGGeJx7
66wAn3hwEPghxTzMWv3Be7W4NIfQSr2o
=53TD
-END PGP SIGNATURE-

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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread Sam Hokin

János Löbb wrote:


How about just using tcpdump during the long delay and see what the 
machine is doing network wise ?


I have, and network timeout was suggested earlier on this thread.  There is no TCP activity of particular interest 
during the delay.  I've hunted for, and not seen, anything to do with the network during the stall.  And IPv6 is turned 
off, by the way.  I can't rule out a network cause, but I've seen nothing with tcpdump or netstat associated with the 
delay to date.  And I can't muck with the network much since it's at a remote data center.  I can drive out there late 
at night to take it offline, for example, but I'd need a quick test plan for that to minimize the downtime.  (I have 
gone out there to test memory and disk, both tested fine.)


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



Re: mod_jk

2009-02-24 Thread Rainer Jung

On 24.02.2009 19:18, Mohit Anchlia wrote:

We have Web Servers talking to Jboss App Servers over mod_jk. When we
do our patch or upgrade of software we do it in rolling fashion so
that there is "0" customer impact. But it looks like mod_jk load
balancer on Web server doesn't detect it as soon as Jboss App Server
goes down. Our goal is to have 0 customer impact. So my question is
what can we do to overcome this problem. Web Server sees Http Error
Code 503.


No configuration, no version information, no log files: not much we can 
help with.


Also: your message subject is not likely to attract helping people.

Sorry,

Rainer

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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread János Löbb


On Feb 24, 2009, at 4:16 PM, Sam Hokin wrote:


Juha Laiho wrote:
One tool that I haven't yet seen suggested is 'strace', the Linux  
system
call tracer. This will show all the calls your application makes to  
the
operating system. As you say the application is mostly idle during  
the

delay, it is, in one way or another, waiting for some OS service to
complete. 'strace' should provide you with timestamped information on
what OS services were called, with which arguments, and how long did
it take for them to return with results. 'strace' will leave you with
a huge file (or a set of huge files, depending on the options you  
use),

and going through them will take some time - but you'll most likely
also find what causes the delay.


Thanks, Juha.  Actually Pieter suggested it a little while ago, and  
I've been trying to get some information out of strace.  The best I  
can do is to put strace in front of the java command that's inside  
catalina.sh.  That's the command that shows with ps -ef when Tomcat  
is running.  BUT, I get nothing out of strace when I make page  
requests on a site, it just shows output during Tomcat startup.  So,  
I've not figured out how to get strace to say what the JVM is during  
the delay.  jstack has led us to a stalled File.exists() in one  
case, but we don't know what file it's looking for.  And I'm not  
convinced that File.exists() is the only method that's stalling.


Since this problem exists only on a production server, a server on  
which I must still serve at least two customer sites (due to DNS  
issues) in addition to our own and any others I put on there, I'm a  
bit restricted in terms of how much I can muck with it (not that I  
haven't brought those live sites down for awkward periods of time  
with the diagnosis I've attempted so far).  I wish I had a test  
environment on another server that replicates this issue, but my  
other two servers run Tomcat perfectly fast, and since I don't  
understand what's causing the problem, I cannot make one of my other  
servers reproduce it.


Another diagnostic problem is that undeploying a context with the  
Tomcat /manager app, and then starting it again, does NOT reset this  
problem - the response to a JSP request is immediate (provided it  
had been requested since the last Tomcat startup).  This problem is  
only reset on a given JSP if I restart Tomcat entirely; I can  
reproduce it by creating fresh JSPs with new names and requesting  
them.


But, clearly, the key diagnostic issue is finding out WHAT is going  
on during the delay that a JSP incurs when it is first requested of  
a given Tomcat instance.  I've not been able to find out from  
strace.  I'll give truss -f and truss -ff a try.




How about just using tcpdump during the long delay and see what the  
machine is doing network wise ?


man tcpdump

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



RE: very slow class loading on initial JSP/servlet request afterrestart

2009-02-24 Thread Caldarale, Charles R
> From: Sam Hokin [mailto:s...@ims.net]
> Subject: Re: very slow class loading on initial JSP/servlet
> request afterrestart

> But, clearly, the key diagnostic issue is finding out WHAT is
> going on during the delay that a JSP incurs when it is
> first requested of a given Tomcat instance.

I'm still wondering if /dev/random is involved; this kind of stall has been 
observed when /dev/random is used instead of /dev/urandom for random byte 
generation.  Don't see why it would be invoked by a File.exists() call, though.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread János Löbb


On Feb 24, 2009, at 3:57 PM, Juha Laiho wrote:


So, looks like I'm late to the party, but will crash in nonetheless.


Sam Hokin wrote:

Christopher Schultz wrote:

On 2/19/2009 6:23 PM, Sam Hokin wrote:
The problem, which spontaneously appeared a few days before  
Christmas on
this one server, is that the initial request of a JSP or servlet  
takes

AGES to respond, usually exceeding several minutes.


Well, I have used a number of diagnostics, like jconsole, jstat and
jhat, but haven't been able to glean anything informative from them
about my issue.  I've run the -Xloggc JVM option, and watched it  
garbage
collect, again not informing me of anything.  Yes, if I could  
figure out

what the JVM is actually DOING doing the long wait, I'd hopefully be
able to deal with it, but I honestly haven't been able to figure  
out how

to do that.  What do you suggest?

I'll cast my hat into the ring: I suspect you're loading a  
resource that
wants to looking an external resource (like an XML file with a  
remote
DTD/Schema and validation is on in the parser) and the DNS is  
tripping

you up.


No, there are no external references in my Java package.  It's all  
just

local class files.


Still it sounds like a network (DNS) issue, but it does not pay to  
just

argue, more information is needed.

One tool that I haven't yet seen suggested is 'strace', the Linux  
system
call tracer. This will show all the calls your application makes to  
the

operating system. As you say the application is mostly idle during the
delay, it is, in one way or another, waiting for some OS service to
complete. 'strace' should provide you with timestamped information on
what OS services were called, with which arguments, and how long did
it take for them to return with results. 'strace' will leave you with
a huge file (or a set of huge files, depending on the options you  
use),

and going through them will take some time - but you'll most likely
also find what causes the delay.

If you decide to go this way, trim down your application to the  
minimum

where you can still see the delay; with this you hopefully can get
at least some reduction to the amount of log data written. Even  
though it

is possible to temporarily attach strace to a running process (like
the Tomcat at the moment when it is hung), I'd recommend starting the
tomcat under truss (with -f or -ff to make it also trace new processes
created), because this way it is easier to trace back the file  
descriptor

numbers accessed.
--
..Juha



It could be other network issue, like having IP6 enabled on the  
machine connected to an IP4 network, or an inefficient routing of  
network traffic for that particular machine.  Sounds like it is timing  
out on some network task.


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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread Sam Hokin

Juha Laiho wrote:


One tool that I haven't yet seen suggested is 'strace', the Linux system
call tracer. This will show all the calls your application makes to the
operating system. As you say the application is mostly idle during the
delay, it is, in one way or another, waiting for some OS service to
complete. 'strace' should provide you with timestamped information on
what OS services were called, with which arguments, and how long did
it take for them to return with results. 'strace' will leave you with
a huge file (or a set of huge files, depending on the options you use),
and going through them will take some time - but you'll most likely
also find what causes the delay.


Thanks, Juha.  Actually Pieter suggested it a little while ago, and I've been trying to get some information out of 
strace.  The best I can do is to put strace in front of the java command that's inside catalina.sh.  That's the command 
that shows with ps -ef when Tomcat is running.  BUT, I get nothing out of strace when I make page requests on a site, it 
just shows output during Tomcat startup.  So, I've not figured out how to get strace to say what the JVM is during the 
delay.  jstack has led us to a stalled File.exists() in one case, but we don't know what file it's looking for.  And I'm 
not convinced that File.exists() is the only method that's stalling.


Since this problem exists only on a production server, a server on which I must still serve at least two customer sites 
(due to DNS issues) in addition to our own and any others I put on there, I'm a bit restricted in terms of how much I 
can muck with it (not that I haven't brought those live sites down for awkward periods of time with the diagnosis I've 
attempted so far).  I wish I had a test environment on another server that replicates this issue, but my other two 
servers run Tomcat perfectly fast, and since I don't understand what's causing the problem, I cannot make one of my 
other servers reproduce it.


Another diagnostic problem is that undeploying a context with the Tomcat /manager app, and then starting it again, does 
NOT reset this problem - the response to a JSP request is immediate (provided it had been requested since the last 
Tomcat startup).  This problem is only reset on a given JSP if I restart Tomcat entirely; I can reproduce it by creating 
fresh JSPs with new names and requesting them.


But, clearly, the key diagnostic issue is finding out WHAT is going on during the delay that a JSP incurs when it is 
first requested of a given Tomcat instance.  I've not been able to find out from strace.  I'll give truss -f and truss 
-ff a try.


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



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread Juha Laiho
So, looks like I'm late to the party, but will crash in nonetheless.


Sam Hokin wrote:
> Christopher Schultz wrote:
>> On 2/19/2009 6:23 PM, Sam Hokin wrote:
>>> The problem, which spontaneously appeared a few days before Christmas on
>>> this one server, is that the initial request of a JSP or servlet takes
>>> AGES to respond, usually exceeding several minutes.
> 
> Well, I have used a number of diagnostics, like jconsole, jstat and
> jhat, but haven't been able to glean anything informative from them
> about my issue.  I've run the -Xloggc JVM option, and watched it garbage
> collect, again not informing me of anything.  Yes, if I could figure out
> what the JVM is actually DOING doing the long wait, I'd hopefully be
> able to deal with it, but I honestly haven't been able to figure out how
> to do that.  What do you suggest?
> 
>> I'll cast my hat into the ring: I suspect you're loading a resource that
>> wants to looking an external resource (like an XML file with a remote
>> DTD/Schema and validation is on in the parser) and the DNS is tripping
>> you up.
> 
> No, there are no external references in my Java package.  It's all just
> local class files.

Still it sounds like a network (DNS) issue, but it does not pay to just
argue, more information is needed.

One tool that I haven't yet seen suggested is 'strace', the Linux system
call tracer. This will show all the calls your application makes to the
operating system. As you say the application is mostly idle during the
delay, it is, in one way or another, waiting for some OS service to
complete. 'strace' should provide you with timestamped information on
what OS services were called, with which arguments, and how long did
it take for them to return with results. 'strace' will leave you with
a huge file (or a set of huge files, depending on the options you use),
and going through them will take some time - but you'll most likely
also find what causes the delay.

If you decide to go this way, trim down your application to the minimum
where you can still see the delay; with this you hopefully can get
at least some reduction to the amount of log data written. Even though it
is possible to temporarily attach strace to a running process (like
the Tomcat at the moment when it is hung), I'd recommend starting the
tomcat under truss (with -f or -ff to make it also trace new processes
created), because this way it is easier to trace back the file descriptor
numbers accessed.
-- 
..Juha

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



Apache -> Tomcat connection problem

2009-02-24 Thread Daryl Stultz
Hello,

I don't know if this is an Apache problem, Tomcat problem, both or neither.
Hopefully someone can point me in the right direction.

I'm running Tomcat 5.5.17 behind Apache 2.2.2. I am connecting with a Tomcat
AJP connector like so:

 

and Apache ProxyPass like so:

ProxyPass /myapp ajp://localhost:8009/myapp/

Apache has the default number of connections set - MaxClients is either 256
or 150, I don't understand the prefork/worker MPM thing. As above, the
Tomcat AJP connector defaults to 200 for maxThreads. The site has 20
applications, each with 2 ProxyPass directives for ports 80 and 443. The
general load on the site is low with 5 - 15 users on at any one time.

This command here, I believe, counts the number of connections between
Apache and Tomcat:

netstat -tn | sed -n -e '1,2p;/8009/p' | wc -l

The site has been running for a couple years, though the code changes and I
continue to add new apps, it has been running fine. Now what seems to be
happening is the number of connections between Apache and Tomcat grows at
various rates from 4 or 10 or 20 after an Apache restart to 400 and more. At
around 400 the site gets very sluggish. This seems to make some sense if
Tomcat has maxThreads of 200 and the above command counts connections in
both directions - TC is running out of connections. The question is why? I
don't have enough users to warrant the connection pool growing like this. I
currently have a cron task that does a graceful restart of Apache after 300
connections. Can anyone shed some light on this or point me to some other
resource for help?

Thanks.

-- 
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com


Problem with sessions on a fedora 10 machine

2009-02-24 Thread Noam Aigerman
Hi,

I've been working with apache tomcat under windows for a few months now.
I've just setup a new fedora server, and deployed a .war file to it's
webapps directory.
Everything is running fine on the fedora machine, except that the
session doesn't seem to "stick".
doing something like the code below in my Servlet:

 

String check=session.getAttribute("check");

System.out.println("this is what I got: "+ check);

session.setAttribute("check","one");

 

And then going to that servlet's page and refreshing or navigating back
and forth form it create the following output in catalina.out:

 

this is what I got: null

this is what I got: null

this is what I got: null

this is what I got: null

 

checking the tomcat & catalina logs, there are no errors present...
web.xml has a timeout of 30...
Under MS it all works great...



Any thoughts?

 

Thanks, Noma



Re: very slow class loading on initial JSP/servlet request after restart

2009-02-24 Thread Sam Hokin

Mark Thomas wrote:

Sam Hokin wrote:

Thanks, Chris.  I ran e2fsck with the -c option, which runs badblocks,
when I tested it earlier.  And I just ran badblocks again - 0 bad blocks
found.  I wish I could fix this by simply as swapping out a bad disk
(notwithstanding Andre's desire for intellectual pursuits), but I really
think it's software, either in some service mucking up the JVM or the
JVM itself.  But it only manifests itself under Tomcat, and then only
when this particular package is imported.


Do you see the same issue if you pre-compile that JSP?


Surprisingly, yes.  So it's not only a compilation issue.  After some individual tests, I compiled the JSPs from the 
four sites I have running on this server and restarted Tomcat, and the LONG delay before Tomcat begins serving page 
requests continues.  I looked at my individual test JSP, now precompiled, and, sure enough, it takes a long time to 
respond to the first request after a Tomcat restart.  In fact, it wasn't any better than when Tomcat compiles them on 
the fly.  So I'm back to thinking the classloader is involved in this delay as well.


I did check, just to be sure, and Tomcat did not write any class files under Catalina/work.  And if I deleted a compiled 
class file on a site, a request throws an error logged in catalina.out.  So, Tomcat is definitely using the compiled 
classes.


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



mod_jk

2009-02-24 Thread Mohit Anchlia
We have Web Servers talking to Jboss App Servers over mod_jk. When we
do our patch or upgrade of software we do it in rolling fashion so
that there is "0" customer impact. But it looks like mod_jk load
balancer on Web server doesn't detect it as soon as Jboss App Server
goes down. Our goal is to have 0 customer impact. So my question is
what can we do to overcome this problem. Web Server sees Http Error
Code 503.

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



Re: Need to look inside JASPER

2009-02-24 Thread Pid
Jordan, Martin wrote:
> Yo, does anyone know how to turn on debugging for what JASPER is doing
> while TOMCAT is running? We would like to see why certain JSPs stop
> working randomly. 

Jasper compiles JSPs into servlets, which are then compiled into
classes.  Are you sure that Jasper is what you want to know about?

Are you modifying the JSPs and then seeing that they 'stop working'?
Or are you experiencing problems with JSPs that have not been modified?


Throwing a platform/tomcat server version number or two into your answer
won't harm...

p


> Thanks
> 
> Mj.
> 
>  
> Martin Jordan
> Solutions Engineer, Solutions Engineering - Technology 
> News International Limited
> 1 Virginia Street
> London  E98 1TH
>  
> Desk: +44 (0) 2077 821 498
> Mob:  +44 (0) 7917 173 202
>  
> 


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



Need to look inside JASPER

2009-02-24 Thread Jordan, Martin
Yo, does anyone know how to turn on debugging for what JASPER is doing
while TOMCAT is running? We would like to see why certain JSPs stop
working randomly. 

 

Thanks

Mj.

 
Martin Jordan
Solutions Engineer, Solutions Engineering - Technology 
News International Limited
1 Virginia Street
London  E98 1TH
 
Desk: +44 (0) 2077 821 498
Mob:  +44 (0) 7917 173 202
 


RE: Request for 'Scriptresource.axd' results in download of 'Scriptresource.txt'

2009-02-24 Thread Caldarale, Charles R
> From: Jordan, Martin [mailto:martin.jor...@newsint.co.uk]
> Subject: RE: Request for 'Scriptresource.axd' results in
> download of 'Scriptresource.txt'
>
> We would like to see why certain JSPs stop
> working randomly.

We would like you to not hijack threads.  Start a new thread when posing a new 
topic; don't reply to an existing message for something completely unrelated.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



RE: Request for 'Scriptresource.axd' results in download of 'Scriptresource.txt'

2009-02-24 Thread Jordan, Martin

Yo, does anyone know how to turn on debugging for what JASPER is doing
while TOMCAT is running? We would like to see why certain JSPs stop
working randomly. 


Thanks
Mj.


Martin Jordan.
 
"Please consider the environment before printing this e-mail" 
 
The Newspaper Marketing Agency:  Opening Up Newspapers:
 
www.nmauk.co.uk
 
This e-mail and all attachments are confidential and may be privileged. If you 
have received this e-mail in error, notify the sender immediately. Do not use, 
disseminate, store or copy it in any way. Statements or opinions in this e-mail 
or any attachment are those of the author and are not necessarily agreed or 
authorised by News International (NI). NI Group may monitor emails sent or 
received for operational or business reasons as permitted by law. NI Group 
accepts no liability for viruses introduced by this e-mail or attachments. You 
should employ virus checking software. News International Limited, 1 Virginia 
St, London E98 1XY, is the holding company for the News International group and 
is registered in England No 81701


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



Re: Request for 'Scriptresource.axd' results in download of 'Scriptresource.txt'

2009-02-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 2/23/2009 3:00 PM, Mark Kimmerly wrote:
> I have written a servlet request filter that inspects the URI of
> incoming requests and redirects them to an IIS server if appropriate
> (such as when a .aspx resource is requested).  To summarize, the filter
> constructs an HttpURLConnection to the IIS server, transfers the GET or
> POST data from the original request to the HttpURLConnection, makes the
> connection, grabs the response from IIS and writes it to the
> HtpServletResponse stream.

Note that this isn't redirection, it's proxying. If you aren't issuing a
3xx response code, it's not redirection.

> This redirection works for most content, but for some reason certain
> files get delivered to the client with the wrong extension.  In
> particular, all ".axd" files end up on the client as ".txt" files.

What do you mean the wrong extension? The URL should dictate the file's
"extension" should the browser choose to download (unless you use a
Content-Disposition header, which I suspect you aren't using).

> I've
> tried setting up a mime-mapping for ".axd" files (as text/javascript) in
> my web.xml, but it didn't solve the problem.

The only thing this changes is the MIME type used to reply to the client.

> Does anyone out there know why the extension gets changed?  Maybe I'm
> leaving out header information when I forward the request on to IIS?

If you mean that the client is interpreting the files as text/plain
instead of text/javascript or text/html or whatever, then that's a MIME
type problem: your Content-Type header is wrong on the response you send
to the client.

You should be copying the Content-Type from IIS's response and setting
that as the Content-Type for the response you send back to the client.
You should set this before you send any of the content.

Also note that MSIE ignores Content-Type headers because it thinks it's
smarter than you are.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmkEhYACgkQ9CaO5/Lv0PB2NQCeIBpZHtI19Ol6tKcJtEDnzSOH
TngAn2SDDbLGu1ttaeHzCU0TBUCWfboo
=2QaZ
-END PGP SIGNATURE-

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



Re: apache tomcat connector header size

2009-02-24 Thread eric tse
Hi Andre and guys,

can you help me

Thanks

Eric

On Thu, Feb 19, 2009 at 3:54 PM, eric tse  wrote:
> Thanks Andre
>
> which Apache/Tomcat connector are you talking about ?
>
> isapi_redirect.dll (1.2.14.0)
>
> The official site is
> http://tomcat.apache.org/connectors-doc/
>
> what versions of Apache, Tomcat, and the connector ?
>
> Proxy on IIS6 windows 2K3, tomcat backend (6.0.18) on solaris 10
>
> on what platform ?
>
>
> You know may proxy server has reverse proxy header size that we can
> tune up. I can't find it in the official doc in this plugin. I don't
> know if you guys can give me a hand.
>
>
> I need your help.
>
> Thanks and regards,
>
> Eric
>
>
> On Wed, Feb 4, 2009 at 1:33 AM, André Warnier  wrote:
>> Eric,
>>
>> I'll answer this, so that you don't feel like being totally ignored, which
>> should really be the case.
>>
>> If you really want an answer however, I suggest you repost with some
>> additional information :
>> - which Apache/Tomcat connector are you talking about ?
>> - what versions of Apache, Tomcat, and the connector ?
>> - on what platform ?
>>
>> and can you also try to be a bit more specific about what your problem is ?
>> Oh, and don't be afraid to include apparently irrelevant details such as
>> what "headers" you are talking about, how big, when, how, the original error
>> message and where it comes from etc..
>>
>>
>>
>>
>> eric tse wrote:
>>>
>>> how can I bump up the header size of connector?
>>>
 apache tomcat connector header ???

 How?

 I think I am trying to a big header transfer .. and it breaks in proxy
 point,
 saying fail to append header. and did route

 Thanks

 Eric Tse
>>>
>>> On Tue, Feb 3, 2009 at 2:08 PM, eric tse  wrote:

 Can I bump up the header size of the

 apache tomcat connector header ???

 How?

 I think I am trying to a big header transfer .. and it breaks in proxy
 point,
 saying fail to append header. and did route

 Thanks

 Eric Tse

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

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



Re: [OT] very slow class loading on initial JSP/servlet request afterrestart

2009-02-24 Thread Pieter Temmerman
Do we know which file file.exists() is trying to check?
May be a good idea to run Tomcat with strace, to see exactly which file
is it trying to access.

On Fri, 2009-02-20 at 21:10 +0100, André Warnier wrote:
> Caldarale, Charles R wrote:
> >> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> >> Subject: Re: very slow class loading on initial JSP/servlet
> >> request afterrestart
> >>
> >> Is this machine running next to any equipment that
> >> generates a lot of stray alpha particles? :)
> > 
> > Nearby won't do it for alpha particles - they have to come from inside. 
> Dark matter then. Like dark chocolate, as suggested by an earlier 
> poster.  I keep being intrigued by the numerology here :
> 2 times 4 cores ..
> 4 Raid disks ..
> 8 reindeer ..
> ...
> 64 bit ..
> it started a few days before Christmas (8 ?)..
> That must be telling us something, we're just not smart enough yet to 
> figure it out.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
-- 
Pieter Temmerman
email: ptemmerman@sadiel.es
skype: ptemmerman.sadiel

SADIEL TECNOLOGÍAS DE LA INFORMACIÓN, S.A. http://www.sadiel.es.




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