tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: daemon thread causing tomcat process to live on
Date Mon, 04 Jun 2012 21:44:36 GMT
Hash: SHA1


On 6/4/12 5:29 PM, wrote:
> I've got a daemon thread that seems to run after the tomcat has 
> received the shutdown signal.  It's a TimerTask and it appears to 
> fire again after the webapp itself has been shutdown.  This then 
> seems to cause the whole jvm to live on, sometimes for a couple of 
> minutes, sometimes much longer.
> The timertask blows up with classnotfounds because the webapp 
> classloader is gone.  Shouldn't it be killed when the webapp is 
> killed?

Tomcat won't stop threads created by your webapp: that's up to you.

> How do I troubleshoot this?

First, you'll have to find out where the thread is being created.
Ideally, it will be created in a ServletContextListener's or a
Servlet's init method. Just add appropriate code to the destroy()
method so shut-down the thread. Depending on what the thread does, you
may need to modify the task being executed so that it can be
gracefully cancelled when your webapp stops.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


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

View raw message