File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes ServletContextListener's contextDestroyed is called while application is still running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContextListener Watch "ServletContextListener New topic
Author

ServletContextListener's contextDestroyed is called while application is still running

subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
Hello I have faced a problem and just wondering how could that happened? So i am having a thread which is running continuously till my application runs...

And stop running via flag which is set in ServletContextListener's contextDestroyed method.

Now my application was up for couple of months with server running continuously without shutdown... But recently i discovered that this thread has been stopped... there is no exception because log should have had it. Which lead to belief that contextDestroy method has been called somehow.

Also one baffling thing is in contextInit i again create the thread.... its hard to understand this behavior has any faced this problem before?

FYI... i am using tomcat...


http://subodh-gupta.blogspot.com
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

One possibility is that, the thread could have been killed.


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletContextListener's contextDestroyed is called while application is still running
 
Similar Threads
ServletContextListener (contextDestroyed) with Threads
how to cope with continuous learning
JMS deployment in WAS3.5
ServletContextListener
Which listener executes last when web application is shutdown