We run our web application wehre we start some Threads for background work and also Quartz. When I try to shutdown tomcat(using shell script on linux), I always get the error saying failed to shutdown tomcat due to daemon threads and Quartz threads. We have tried different ways to shutdown our threads (exit out of run method) but we rely on few static variables of a class to do this which become null by the time my shut down listener gets a callback
Is there a standard approach to shut down tomcat for such a scenario?