File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes destroy() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "destroy() method " Watch "destroy() method " New topic

destroy() method

Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
Isn't it mandatory for the servlet engines/app.servers to call this method when they are shut down? I am testing the servlets with Resin 2.0.5 and Tomcat 3.3.1. My Servlet has a log statement in the destroy() method which never gets written to the log file (I see all the other log statements), which makes me believe that this method is not being called. So, is this method only called when the servlet is 'unloaded'? If yes, how will the servlets be able to clean up after themselves in case the app.server shuts down?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
How are you telling the server to shut down? Are you using the Shutdown script provided?
I agree. Here's the link:
subject: destroy() method
It's not a secret anymore!