From fc4b3d7a5040d9a392cf1bd0a88239701b0fb5d7 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 6 Oct 2010 22:54:13 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49957 Correct regression due to Lifecycle re-factoring that cleared all work directories (with compiled JSPs and persisted sessions) when Tomcat was stopped. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1005284 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/startup/HostConfig.java | 28 ---------------------- .../catalina/startup/LocalStrings.properties | 1 - webapps/docs/changelog.xml | 5 ++++ 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index ec82b5dab..0a986a42d 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -1332,8 +1332,6 @@ public class HostConfig if (log.isDebugEnabled()) log.debug(sm.getString("hostConfig.stop")); - undeployApps(); - if (oname != null) { try { Registry.getRegistry(null, null).unregisterComponent(oname); @@ -1349,32 +1347,6 @@ public class HostConfig /** - * Undeploy all deployed applications. - */ - protected void undeployApps() { - - if (log.isDebugEnabled()) - log.debug(sm.getString("hostConfig.undeploying")); - - // Soft undeploy all contexts we have deployed - DeployedApplication[] apps = - deployed.values().toArray(new DeployedApplication[0]); - for (int i = 0; i < apps.length; i++) { - try { - host.removeChild(host.findChild(apps[i].name)); - } catch (Throwable t) { - ExceptionUtils.handleThrowable(t); - log.warn(sm.getString - ("hostConfig.context.remove", apps[i].name), t); - } - } - - deployed.clear(); - - } - - - /** * Check status of all webapps. */ protected void check() { diff --git a/java/org/apache/catalina/startup/LocalStrings.properties b/java/org/apache/catalina/startup/LocalStrings.properties index b236ca8be..695cc7edf 100644 --- a/java/org/apache/catalina/startup/LocalStrings.properties +++ b/java/org/apache/catalina/startup/LocalStrings.properties @@ -99,7 +99,6 @@ hostConfig.start=HostConfig: Processing START hostConfig.stop=HostConfig: Processing STOP hostConfig.undeploy=Undeploying context [{0}] hostConfig.undeploy.error=Error undeploying web application at context path {0} -hostConfig.undeploying=Undeploying deployed web applications tldConfig.addListeners=Adding {0} listeners from TLD files tldConfig.cce=Lifecycle event data object {0} is not a Context tldConfig.dirFail=Failed to process directory [{0}] for TLD files diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 435155b65..4b0b2cd34 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -70,6 +70,11 @@ 49956: Handle case when @Resource annotation uses the full JNDI name for a resource. Based on a patch by Gurkan Erdogdu. (markt) + + 49557: Correct regression due to Lifecycle refactoring that + cleared all work directories (with compiled JSPs and persisted sessions) + when Tomcat was stopped. (markt) + -- 2.11.0