Remove reflection part of stack trace when Catalina throws an Exception - makes it...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 19 Jan 2011 18:14:51 +0000 (18:14 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 19 Jan 2011 18:14:51 +0000 (18:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1060891 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/Bootstrap.java

index d9bf2da..770fde6 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.catalina.startup;
 
 import java.io.File;
 import java.lang.management.ManagementFactory;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -442,6 +443,11 @@ public final class Bootstrap {
             }
         } catch (Throwable t) {
             handleThrowable(t);
+            // Unwrap the Exception for clearer error reporting
+            if (t instanceof InvocationTargetException &&
+                    t.getCause() != null) {
+                t = t.getCause();
+            }
             t.printStackTrace();
             System.exit(1);
         }