On Mon, Apr 20, 2009 at 9:29 AM, Paolo Gambetti <gambetti.pa...@gmail.com> wrote: > I have this problem. If in my web application running in Tomcat there is a > java thread running when i stop Tomcat with shutdown.bat or shutdown.sh > tomcat process doesn't end and i have to kill it manually. How can i solve > this problem? Is there anything to change in java threads code? > thank you. >
Make this thread a daemon (setDaemon(true)) in constructor. This will tell the VM that its ok to exit without waiting for this thread. If you want to give the Thread the possibility to finish some job before shutting down, don't make it daemon, but register a ShutdownHook instead. Also, in the latter case, check for Executor patterns in java 1.5 regards Leon --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org