I have developed a multithreaded web application that runs in Tomcat. But I cannot use
shutdown.bat
Tomcat didn\'t stop gracefully. In the deb
You need to cancel your threads, preferably by calling interrupt
on them and making sure they are written in such a way that they respond to the interruption -- meaning, checking their interrupted flag and responding intelligently to InterruptedExceptions (not just eating them and continuing on).
The above advice assumes you don't want your threads to drop what they're doing immediately. If you are ok with that then make them daemons.