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
You can also write a tiny java Instrumentation agent to wrap the thread constructor (and stack dump there), instead of trying to mod the rt.jar classes.