Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49865
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 3 Sep 2010 20:37:46 +0000 (20:37 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 3 Sep 2010 20:37:46 +0000 (20:37 +0000)
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

java/org/apache/catalina/startup/CatalinaProperties.java
webapps/docs/changelog.xml

index bfa608e..0482c85 100644 (file)
@@ -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
+    }
 
 }
index 348b1a2..3b28785 100644 (file)
         and Tomcat 7. (markt) 
       </fix>
       <fix>
+        <bug>49865</bug>: Tomcat failed to start if catalina.properties was not
+        present. (markt)
+      </fix>
+      <fix>
         <bug>49876</bug>: Fix the generics warnings in the copied Apache Jakarta
         BCEL code. Based on a patch by Gábor. (markt) 
       </fix>