Summary: | ServletContextListener.contextDestroyed not completely executed when updating war | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | M. Laponder <marco.laponder> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | michael.bauland, yohei_hina |
Priority: | P2 | ||
Version: | 7.0.52 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
test project
contexttest.war |
Description
M. Laponder
2014-03-27 10:43:45 UTC
Created attachment 31446 [details]
test project
Are you sure the log hasn't just been buffered? Tomcat doesn't kill threads like that. Can you post a thread dump after "Context Destroyed" has been printed? The test is using stdout. It is unlikely to be buffered for any noticeable length of time. I can reproduce this on 7.0.x. Odd. Trying on 8.0.x... OK. Found the problem. Deleting the WAR triggered a code path the undeployed the app and then deleted the expanded directory so the new class was available to load during undeployment. Updating the WAR triggered a code path that deleted the expanded directory and then undeployed the app. That meant the new class was not available to load at the point. I've fixed this my making the process consistent (undeploy then delete). This has been fixed in 8.0.x for 8.0.6 onwards and 7.0.x for 7.0.54 onwards. Is this bug fixed? I can reproduce this on 7.0.54.... Created attachment 31688 [details]
contexttest.war
WAR file, build from java files in "test project"
Compiled with JDK 1.5 (can be used to test Tomcat 6, if anyone is interested)
(In reply to Yohei Hina from comment #5) > Is this bug fixed? Yes. Using the test war attached to this issue, the scenario in the Description above, current Tomcat 7.0.x and Java 7u55 on Windows, I see that it works correctly. [[[ Jun 04, 2014 3:29:30 PM org.apache.catalina.startup.HostConfig undeploy INFO: Undeploying context [/contexttest] Context Destroyed My static method call Context Destroyed Done Jun 04, 2014 3:29:30 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive ******\webapps\contexttest.war Context Initialized Jun 04, 2014 3:29:30 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive ******\webapps\contexttest.war has finished in 131 ms ]]] The commit for this issue is r1582454 (r1582453 for Tomcat 8). |