tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Kutzinski <>
Subject Re: HttpSessionListener
Date Thu, 26 May 2005 08:00:43 GMT
Hi Randy,

Randy George wrote:

>Hi Will and Christopher,
>	Good thought. I shut down Tomcat and started it again with a clean
>set of logs:
>   .
>   .
>May 25, 2005 11:22:17 AM org.apache.catalina.core.ApplicationContext log
>INFO: SessionListener: contextInitialized()
>May 25, 2005 11:27:45 AM org.apache.catalina.core.ApplicationContext log
>INFO: SessionListener: sessionCreated('BD963D7E6AACE0E2387F37919BB277FC')
>	I interpret this to show that the listener element in web.xml is
>initialized and later a sessionCeated() method was actually called:
>                      .
>                      .
>    public synchronized void sessionCreated (HttpSessionEvent se) {
>        System.out.println("sessionCreated "+sessionCount);
>        sessionCount++;
>    }
>However, there is no entry in the stout log so whatever sessionCreated
>method is called it is not the one registered?
>	<listener>
>		<listener-class>com.test.SessionCounter</listener-class>
>	</listener>
Yes that is my thought, too. There is a SessionListener initialized but 
apparently not yours. You should put a log statement into the 
constructor of your listener and make sure.
You didn't answer my question about deployment: do you deploy your 
application on the development and the production box in the same way. 
If not, you should try to do it in the same way on the devel box as you 
do on the prod box and look if the problem appears on the prod box, too.
Another idea: the name (com.test.SessionCounter) of your listenere is 
not very "unique". Maybe there is a conflcit with an existing class in 
Tomcats shared or common folder on the production system. Are there any 
other applications installed on the production tomcat?

>I also just noticed that the Tomcat WebApp Manager is showing only 0's for
>sessions regardless of how many sessions are started?
That is really strange. Are you sure that you are hitting the production 
tomcat with your tests? Any other log entries which could confirm that?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message