tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33463] New: - Struts PlugIn.destroy() method not called when WebApp stopped in Tomcat 5.5.7
Date Wed, 09 Feb 2005 11:32:50 GMT
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=33463>.
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=33463

           Summary: Struts PlugIn.destroy() method not called when WebApp
                    stopped in Tomcat 5.5.7
           Product: Tomcat 5
           Version: 5.5.7
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: kap@apama.com
                CC: kap@apama.com


I have a Struts 1.1 application that has worked fine in Tomcat 4.1.x, 5.0.x, 
but does not function correctly under Tomcat 5.5.7.

Specifically, my Struts application registers a PlugIn class (which just 
implements the 2 methods of the interface, i.e. init() and destroy()).  The 
init() method is called just fine as the app is started, but the destroy() 
method is not called when the app is stopped.  We are using the Manager 
application to start and stop the web app.

This can be reproduced by simply adding a PlugIn implementation to the struts-
examples.war - see example plugin below.

Interestingly, the destroy method of a plain servlet IS called when the app is 
stopped (this is our workaround just now).  It would appear that when the 
Struts ActionServlet.destroyModules() method is called, it performs the 
following:
Enumeration names = getServletContext().getAttributeNames();
This enumeration is empty, and hence it is unable to notify the plugin.

Hope this is detailed enough.

For reference, this is on Win XP SP2, JRE 1.5.0_01, Tomcat 5.5.7, Struts 1.1


Cheers,

Kev Palfreyman
Apama UK Ltd.


Example PlugIn:

>From struts-config.xml:

	<plug-in className="ApamaDebugPlugIn"></plug-in>


import org.apache.struts.action.PlugIn;
import org.apache.struts.action.ActionServlet;
import javax.servlet.ServletException;
import org.apache.struts.config.ModuleConfig;

public class ApamaDebugPlugIn implements PlugIn {

	public void init(ActionServlet servlet, ModuleConfig config) throws 
ServletException {
		System.out.println("ApamaDebugPlugin.init()");
	} 


	public void destroy() {
		System.out.println("ApamaDebugPlugin.destroy()");
	}
}

-- 
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message