From a666fe469c34b4979b00d7df8cea5eae94f48b1a Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 29 Sep 2010 10:15:51 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50021 Don't reference ExceptionUtisl from Bootstrap - it won't be visible at startup. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1002562 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/startup/Bootstrap.java | 17 +++++++++++++---- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/startup/Bootstrap.java b/java/org/apache/catalina/startup/Bootstrap.java index e47cb3fc6..613937554 100644 --- a/java/org/apache/catalina/startup/Bootstrap.java +++ b/java/org/apache/catalina/startup/Bootstrap.java @@ -35,7 +35,6 @@ import org.apache.catalina.Globals; import org.apache.catalina.security.SecurityClassLoad; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.ExceptionUtils; /** @@ -99,7 +98,7 @@ public final class Bootstrap { catalinaLoader = createClassLoader("server", commonLoader); sharedLoader = createClassLoader("shared", commonLoader); } catch (Throwable t) { - ExceptionUtils.handleThrowable(t); + handleThrowable(t); log.error("Class loader creation threw exception", t); System.exit(1); } @@ -393,7 +392,7 @@ public final class Bootstrap { try { bootstrap.init(); } catch (Throwable t) { - ExceptionUtils.handleThrowable(t); + handleThrowable(t); t.printStackTrace(); return; } @@ -423,7 +422,7 @@ public final class Bootstrap { log.warn("Bootstrap: command \"" + command + "\" does not exist."); } } catch (Throwable t) { - ExceptionUtils.handleThrowable(t); + handleThrowable(t); t.printStackTrace(); } @@ -502,4 +501,14 @@ public final class Bootstrap { } + // Copied from ExceptionUtils since that class is not visible during start + private static void handleThrowable(Throwable t) { + if (t instanceof ThreadDeath) { + throw (ThreadDeath) t; + } + if (t instanceof VirtualMachineError) { + throw (VirtualMachineError) t; + } + // All other instances of Throwable will be silently swallowed + } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 9260301b6..0616d9f50 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -175,6 +175,11 @@ 50018: Fix some minor Javadoc errors in Jasper source. Based on a patch by sebb. (timw) + + 50021: Correct a regression in the fix for 46844 + that may have caused additional problems during a failure at start up. + (markt) + -- 2.11.0