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 control of the class you can catch the stack trace when it is created:
public class Test extends TimerTask {
final StackTraceElement[] callerStack;
public Test () {
callerStack = Thread.currentThread().getStackTrace();
}
@Override
public void run() {
System.out.println("AAAA");
System.out.println("Creator: "+Arrays.asList(callerStack));
}
@Override
public String toString () {
return "Test created by "+Arrays.asList(callerStack);
}
}