in tomcat,if a webapp did stop a none daemon thread,tomcat can not be shutdown by shutdown.sh
for example:
public class demo implements ServletContex
If you have an IDE like Eclipse or Intellij, you can set break points in the various Thread constructors. You can remotely attach to process using the debugger. The debugger will stop the process when the thread is being constructed. You can observe things like the thread name. You can also use break points with condition if you want to match on the specific thread name.
Setting break points. https://www.ibm.com/developerworks/library/os-ecbug/
Remote debugging https://dzone.com/articles/a-practical-guide-to-java-remote-debugging-in-the