How can i detect that my application is being undeployed ?
I'm starting several threads that do not get stopped when application is redeployed and I would like to stop them.
do not work.
Have you considered a ServletContextListener? It supports two methods:
contextInitialized() and contextDestroyed(). In the impl of these methods you can execute initialization and cleanup code.