struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Holmes (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-2381) Destroy method of Interceptor is never called by Struts
Date Thu, 07 Aug 2008 01:40:24 GMT

     [ https://issues.apache.org/struts/browse/WW-2381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Holmes updated WW-2381:
-----------------------------

            Flags: [Patch]
    Fix Version/s:     (was: Future)
                   2.1.3

> Destroy method of Interceptor is never called by Struts
> -------------------------------------------------------
>
>                 Key: WW-2381
>                 URL: https://issues.apache.org/struts/browse/WW-2381
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.9
>         Environment: Window XP, Apache Tomcat 5.5.23, Java 5, Eclise 3.2
>            Reporter: Décio Heinzelmann Luckow
>             Fix For: 2.1.3
>
>         Attachments: InterceptorDestroy.diff
>
>
> I was testing the Interceptor behavior, and put an breakpoint inside the methods init
and destroy of Interceptor (TestInterceptor created). The init method was ok, the  breakpoint
stopped on the server startup.
> To test the breakpoint of destroy method I does:
> - normal shutdown of tomcat (via Tomcat plugin in Eclipse)
> - redeploy the application
> - changed some classes to tomcat do the automatic reload
> But any of this cases the destroy method was called. I seach in the source code to find
it and understand when it is called, but I don´t found.
> I use the 2.09 version, but is possible that it occurs in all versions of Struts2
> Attached the conversation about this in dev-list
> Tom Schneider wrote:
> You know, I think you're right!  I searched the entire codebase (both xwork and struts)
and I have found nowhere where we call destroy() on the interceptors.  I guess that hasn't
been an issue because if the destroy isn't being called, no big deal because your usually
shutting down anyway.
> If we were to call destroy on the interceptors, I would expect it to happen in the cleanup()
method of Dispatcher.  This is where all the rest of the cleanup happens.  At runtime, the
list of interceptors is stored in the ActionConfig object.  (part of xwork)  Perhaps it might
be a good idea to submit a patch that fixes this issue. :) (hint, hint) Tom
> Dale Newfield wrote:
> This might be why undeploying a struts webapp tends to fail (the struts core and plugin
jars can't be removed because they're still in use).
> Ted Husted wrote:
> I haven't traced the code, but I believe we redeploy the Interceptors in dev mode, making
a destroy option more important.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message