jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes not freeing servlet on shutdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "not freeing servlet on shutdown" Watch "not freeing servlet on shutdown" New topic

not freeing servlet on shutdown

Manoj John
Ranch Hand

Joined: May 13, 2004
Posts: 36
I need urgent help for this please help...
I am using tomcat-5.0.19. How i can meke sure that my servlet application
is destroyed on shuttingdown the server.I am suspectng that it is not doing...bcz i am getting problem on restarting the server.
I am loading the servlet on startup...
I am thinking of using eventhandler to catch and freeing resources explicitly whenever the server is going to shutdown.please give some input on this how i can do this? am i in right path?
if any other solution is there please give......
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
If the server is shutting down properly, the servlet destroy() method should be getting called. Thats a convenient place to ensure that resources are freed and put a System.out.println statement.
You could also use a custom class implementing the ServletContextListener interface, but that appears to require more configuration.
I agree. Here's the link: http://aspose.com/file-tools
subject: not freeing servlet on shutdown
It's not a secret anymore!