You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by jo...@skynet.be on 2004/06/10 14:50:04 UTC

No destroy() method called on Tomcat 5.0.24 shutdown

Hi,

During the shutdown sequence of my Web Application I would like to have some code executed. I implemented the destroy() method of a Servlet and implemented a ServletContextListener.

Both of these get called when the application is reloaded.
But neither of these is called when I shutdown Tomcat.

Shouldn't these methods get called no matter how the servlet is being taken out of service:

<quote>
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls this method, it will not call the service method again on this servlet.

This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state in memory. </quote>


I am using Tomcat 5.0.24
This is on Windows 2K/XP
Using And controlling Tomcat using the Tomcat Monitor.

Regards,

Johan Philippe