Include root cause in LifecycleException stack traces
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 21:25:07 +0000 (21:25 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 21:25:07 +0000 (21:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1042798 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/LifecycleException.java
java/org/apache/catalina/connector/Connector.java
java/org/apache/catalina/connector/LocalStrings.properties

index ee94ef1..54aa3f0 100644 (file)
@@ -39,9 +39,7 @@ public final class LifecycleException extends Exception {
      * Construct a new LifecycleException with no other information.
      */
     public LifecycleException() {
-
-        this(null, null);
-
+        super();
     }
 
 
@@ -51,9 +49,7 @@ public final class LifecycleException extends Exception {
      * @param message Message describing this exception
      */
     public LifecycleException(String message) {
-
-        this(message, null);
-
+        super(message);
     }
 
 
@@ -63,9 +59,7 @@ public final class LifecycleException extends Exception {
      * @param throwable Throwable that caused this exception
      */
     public LifecycleException(Throwable throwable) {
-
-        this(null, throwable);
-
+        super(throwable);
     }
 
 
@@ -77,72 +71,6 @@ public final class LifecycleException extends Exception {
      * @param throwable Throwable that caused this exception
      */
     public LifecycleException(String message, Throwable throwable) {
-
-        super();
-        this.message = message;
-        this.throwable = throwable;
-
+        super(message, throwable);
     }
-
-
-    //------------------------------------------------------ Instance Variables
-
-
-    /**
-     * The error message passed to our constructor (if any)
-     */
-    protected String message = null;
-
-
-    /**
-     * The underlying exception or error passed to our constructor (if any)
-     */
-    protected Throwable throwable = null;
-
-
-    //---------------------------------------------------------- Public Methods
-
-
-    /**
-     * Returns the message associated with this exception, if any.
-     */
-    @Override
-    public String getMessage() {
-
-        return (message);
-
-    }
-
-
-    /**
-     * Returns the throwable that caused this exception, if any.
-     */
-    public Throwable getThrowable() {
-
-        return (throwable);
-
-    }
-
-
-    /**
-     * Return a formatted string that describes this exception.
-     */
-    @Override
-    public String toString() {
-
-        StringBuilder sb = new StringBuilder("LifecycleException:  ");
-        if (message != null) {
-            sb.append(message);
-            if (throwable != null) {
-                sb.append(":  ");
-            }
-        }
-        if (throwable != null) {
-            sb.append(throwable.toString());
-        }
-        return (sb.toString());
-
-    }
-
-
-}
+}
\ No newline at end of file
index 9ec57b8..b65250e 100644 (file)
@@ -904,7 +904,7 @@ public class Connector extends LifecycleMBeanBase  {
         } catch (Exception e) {
             throw new LifecycleException
                 (sm.getString
-                 ("coyoteConnector.protocolHandlerInitializationFailed", e));
+                 ("coyoteConnector.protocolHandlerInitializationFailed"), e);
         }
 
         onameProtocolHandler = register(protocolHandler,
@@ -935,7 +935,7 @@ public class Connector extends LifecycleMBeanBase  {
 
             throw new LifecycleException
                 (errPrefix + " " + sm.getString
-                 ("coyoteConnector.protocolHandlerStartFailed", e));
+                 ("coyoteConnector.protocolHandlerStartFailed"), e);
         }
 
         mapperListener.start();
@@ -957,7 +957,7 @@ public class Connector extends LifecycleMBeanBase  {
         } catch (Exception e) {
             throw new LifecycleException
                 (sm.getString
-                 ("coyoteConnector.protocolHandlerStopFailed", e));
+                 ("coyoteConnector.protocolHandlerStopFailed"), e);
         }
 
         mapperListener.stop();
@@ -974,7 +974,7 @@ public class Connector extends LifecycleMBeanBase  {
         } catch (Exception e) {
             throw new LifecycleException
                 (sm.getString
-                 ("coyoteConnector.protocolHandlerDestroyFailed", e));
+                 ("coyoteConnector.protocolHandlerDestroyFailed"), e);
         }
 
         if (getService() != null) {
index 02d5efb..70131a3 100644 (file)
 # CoyoteConnector
 #
 coyoteConnector.cannotRegisterProtocol=Cannot register MBean for the Protocol
-coyoteConnector.protocolHandlerDestroyFailed=Protocol handler destroy failed: {0}
-coyoteConnector.protocolHandlerInitializationFailed=Protocol handler initialization failed: {0}
-coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation failed: {0}
-coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed: {0}
+coyoteConnector.protocolHandlerDestroyFailed=Protocol handler destroy failed
+coyoteConnector.protocolHandlerInitializationFailed=Protocol handler initialization failed
+coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation failed
+coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed
 coyoteConnector.protocolRegistrationFailed=Protocol JMX registration failed
 coyoteConnector.protocolHandlerPauseFailed=Protocol handler pause failed
 coyoteConnector.protocolHandlerResumeFailed=Protocol handler resume failed