Tomcat hangs in shutdown

tomcat

I have a Tomcat server that won't shut down.

It is listening on the correct port (8005, for this one) to receive the SHUTDOWN command. I can issue that command, either with the bin/shutdown.sh script or by telnetting to that port and typing SHUTDOWN.

At this point, the shutdown port closes; I can no longer connect to it. The AJP13 port stays open, though; nothing is logged in catalina.out, and things don't shut down.

Anyone seen this before?

This is on Solaris 10 on Sparc, if it matters (it probably doesn't) and Tomcat version 6.0.20.

Best Answer

I often have this happen. It depends on the webapps you are running. If you have threads that are not running in daemon mode they must stop before Tomcat shuts down. My logs will say "Waiting to deallocate thread" but Tomcat will never stop.

When you've installed Tomcat on a production system, you have to put a script in /etc/init.d that actually kills the process if it doesn't stop after 30 seconds. Never just shut down and restart Tomcat from the command line with the standard scripts in $CATALINA_HOME/bin or you may get two instances running.