You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/08/19 21:17:13 UTC

DO NOT REPLY [Bug 30762] New: - destroy method in servlet called before contextDestroyed method in ServletContextListener class.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30762>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30762

destroy method in servlet called before contextDestroyed method in ServletContextListener class.

           Summary: destroy method in servlet called before contextDestroyed
                    method in ServletContextListener class.
           Product: Tomcat 5
           Version: 5.0.27
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: dldiehl@yahoo.com
                CC: dldiehl@yahoo.com


I created an implementation of ServletContextListener and was expecting its 
contextDestroyed(ServletContextEvent event) method to be invoked AFTER the 
destroy() method of the single servlet for the web app.  The 2.4 servlet spec 
states:

public void contextDestroyed(ServletContextEvent sce)
  Notification that the servlet context is about to be shut down. All servlets 
and filters have been destroy()ed before any ServletContextListeners are 
notified of context destruction.


Using Tomcat 5.0.25 and 5.0.27, the servlet destroy() method was invoked AFTER 
the contextDestroyed() method, in violation of the spec.  I tried with and 
without <load-on-startup> in the web.xml to see if this made a difference, and 
it did not.

NOTE:  The order of calls on the initialization side was correct and as I 
expected.  The method contextInitialized(ServletContextEvent event) in my 
ServletContextListener class was called before the init() methods of my 
servlet (and filters).

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org