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=32559>. 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=32559 Summary: ServletContextAttributeEvent.attributeRemoved not called on stop Product: Tomcat 4 Version: 4.1.31 Platform: PC OS/Version: All Status: NEW Severity: major Priority: P2 Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Bug report: -------------------------------------------------------------------------------- As described in the example shown in the Servlet 2.3 specs (SRV 10.2.2), the ServletContextAttributeEvent.attributeRemoved method should be called when stopping a webapp. However Tomcat 4.1.31 exhibits bad implementation of the specs, as it doesn't call the attributeRemoved methods when stopping an application. It calls them only when reloading an application. After reading the sources, it's clear that "reload" and "stop" mismatch on two points: - ApplicationContext.clearAttributes call is missing in the StandardContext.stop() method whereas it is present in the reload method. - The reload method and the stop method mismatch on the order of certain method calls, and i think this can introduce some behavior differences (not observed except for the missing clearAttributes call). A brief review of the Tomcat 5.5 CVS sources make me think this bug may still exist in the latest dev tree, however as the code changed quite a bit, i'm not sure the event call mechanism is still the same. If the event calling mechanism is the same, and as "reload" is simply a wrapper on top of "start" and "stop", both "reload" and "stop" would miss the clearAttributes call. I'm sorry but i had no time to confirm the bug on Tomcat 5.5 tree. How to trigger the bug: -------------------------------------------------------------------------------- - Create a simple webapp, add a ServletContextAttributeEvent object that simply logs the events and declare it in the web.xml file. Add a Servlet loaded on startup that adds a few attributes to the servlet context. - Go to the tomcat manager 1 - reload the application: the listener attributeRemoved method is called and logs the event then the listener attributeAdded method is called and logs the event 2 - stop the application Only the listener attributeAdded method is called and logs the event -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]