Any idea why stopping Tomcat almost always hang ?
2 answers
It seems that when you ask Tomcat to stop gracefully, it does not behave so gracefully. In my experience (on Linux and lightly used though), sometimes I have to wait more than 10 minutes for Tomcat to stop by itself. I guess it all depends what threads are running when the stop command is issued - some threads react quickly and some thread get stuck.
Apparently you can use "-force" on Linux and the catalina.sh script will call the "kill" command when the set timeout is reached. On Windows, you will need to implement similar approach by yourself.
http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-tomcat-6-0-a-940165/
http://serverfault.com/questions/546360/how-to-force-tomcat-to-shutdown-after-x-number-of-seconds-on-windows
Apparently you can use "-force" on Linux and the catalina.sh script will call the "kill" command when the set timeout is reached. On Windows, you will need to implement similar approach by yourself.
http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-tomcat-6-0-a-940165/
http://serverfault.com/questions/546360/how-to-force-tomcat-to-shutdown-after-x-number-of-seconds-on-windows