You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pu...@web.de on 2010/08/24 11:20:26 UTC

Own Logging Handler not closing correctly

Tomcat: 6.0.29
OS: Mac OS
Java: 1.5


I wrote an own java.util.logging.Handler to get the logs over the network. The handler is configured via "myWebapp/WEB-INF/classes/logging.properties" and is working very well. The handler uses some threads to do his job. I used the close()-Method to interrupt them. But when shutting tomcat down or doing an undeploy I always get messages like this:

-------
23.08.2010 23:43:14 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsSEVERE: The web application [/testWebapp] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
23.08.2010 23:43:14 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsSEVERE: The web application [/testWebapp] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
-------

Theses threads were started by the handler and can not be stopped by tomcat. Interestingly the cose()-Methode of my handler - where the handler would kill these threads - gets called after theses messages...

I don't really know how to understand these messages? Why are theses messages produced before calling the close() Method of the handler?

Thanks a lot!
___________________________________________________________
WEB.DE DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für 
nur 19,99 ¿/mtl.!* http://web.de/DSL-Doppel-Flatrate/

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


Re: Own Logging Handler not closing correctly

Posted by Mark Thomas <ma...@apache.org>.
On 24/08/2010 10:20, pue85@web.de wrote:
> Tomcat: 6.0.29
> OS: Mac OS
> Java: 1.5
> 
> 
> I wrote an own java.util.logging.Handler to get the logs over the network. The handler is configured via "myWebapp/WEB-INF/classes/logging.properties" and is working very well. The handler uses some threads to do his job. I used the close()-Method to interrupt them. But when shutting tomcat down or doing an undeploy I always get messages like this:
> 
> -------
> 23.08.2010 23:43:14 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsSEVERE: The web application [/testWebapp] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
> 23.08.2010 23:43:14 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsSEVERE: The web application [/testWebapp] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
> -------
> 
> Theses threads were started by the handler and can not be stopped by tomcat. Interestingly the cose()-Methode of my handler - where the handler would kill these threads - gets called after theses messages...
> 
> I don't really know how to understand these messages? Why are theses messages produced before calling the close() Method of the handler?

It is to do with the order in which the context is shut down. The check
for threads is made before the logging system is shut down.

Mark

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