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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to