From: markt Date: Fri, 3 Sep 2010 20:37:46 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49865 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c6bdc2e67d2cf4869fa9ef04f2715f5315d1cd3a;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49865 Allow Tomcat to start if catalina.properties is not present git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@992459 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/CatalinaProperties.java b/java/org/apache/catalina/startup/CatalinaProperties.java index bfa608ed9..0482c85ef 100644 --- a/java/org/apache/catalina/startup/CatalinaProperties.java +++ b/java/org/apache/catalina/startup/CatalinaProperties.java @@ -26,7 +26,6 @@ import java.util.Enumeration; import java.util.Properties; import org.apache.catalina.Globals; -import org.apache.tomcat.util.ExceptionUtils; /** @@ -99,8 +98,7 @@ public class CatalinaProperties { is = (new URL(configUrl)).openStream(); } } catch (Throwable t) { - // TODO Throws NoClassDefFoundError for ExceptionUtils - ExceptionUtils.handleThrowable(t); + handleThrowable(t); } if (is == null) { @@ -110,8 +108,7 @@ public class CatalinaProperties { File properties = new File(conf, "catalina.properties"); is = new FileInputStream(properties); } catch (Throwable t) { - // TODO Throws NoClassDefFoundError for ExceptionUtils - ExceptionUtils.handleThrowable(t); + handleThrowable(t); } } @@ -120,8 +117,7 @@ public class CatalinaProperties { is = CatalinaProperties.class.getResourceAsStream ("/org/apache/catalina/startup/catalina.properties"); } catch (Throwable t) { - // TODO Throws NoClassDefFoundError for ExceptionUtils - ExceptionUtils.handleThrowable(t); + handleThrowable(t); } } @@ -179,5 +175,15 @@ public class CatalinaProperties { return System.getProperty("catalina.config"); } + // 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 348b1a233..3b28785ae 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -111,6 +111,10 @@ and Tomcat 7. (markt) + 49865: Tomcat failed to start if catalina.properties was not + present. (markt) + + 49876: Fix the generics warnings in the copied Apache Jakarta BCEL code. Based on a patch by Gábor. (markt)