You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/12/06 22:25:07 UTC

svn commit: r1042798 - in /tomcat/trunk/java/org/apache/catalina: LifecycleException.java connector/Connector.java connector/LocalStrings.properties

Author: markt
Date: Mon Dec  6 21:25:07 2010
New Revision: 1042798

URL: http://svn.apache.org/viewvc?rev=1042798&view=rev
Log:
Include root cause in LifecycleException stack traces

Modified:
    tomcat/trunk/java/org/apache/catalina/LifecycleException.java
    tomcat/trunk/java/org/apache/catalina/connector/Connector.java
    tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/catalina/LifecycleException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/LifecycleException.java?rev=1042798&r1=1042797&r2=1042798&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/LifecycleException.java (original)
+++ tomcat/trunk/java/org/apache/catalina/LifecycleException.java Mon Dec  6 21:25:07 2010
@@ -39,9 +39,7 @@ public final class LifecycleException ex
      * Construct a new LifecycleException with no other information.
      */
     public LifecycleException() {
-
-        this(null, null);
-
+        super();
     }
 
 
@@ -51,9 +49,7 @@ public final class LifecycleException ex
      * @param message Message describing this exception
      */
     public LifecycleException(String message) {
-
-        this(message, null);
-
+        super(message);
     }
 
 
@@ -63,9 +59,7 @@ public final class LifecycleException ex
      * @param throwable Throwable that caused this exception
      */
     public LifecycleException(Throwable throwable) {
-
-        this(null, throwable);
-
+        super(throwable);
     }
 
 
@@ -77,72 +71,6 @@ public final class LifecycleException ex
      * @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

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1042798&r1=1042797&r2=1042798&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Mon Dec  6 21:25:07 2010
@@ -904,7 +904,7 @@ public class Connector extends Lifecycle
         } 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 Lifecycle
 
             throw new LifecycleException
                 (errPrefix + " " + sm.getString
-                 ("coyoteConnector.protocolHandlerStartFailed", e));
+                 ("coyoteConnector.protocolHandlerStartFailed"), e);
         }
 
         mapperListener.start();
@@ -957,7 +957,7 @@ public class Connector extends Lifecycle
         } catch (Exception e) {
             throw new LifecycleException
                 (sm.getString
-                 ("coyoteConnector.protocolHandlerStopFailed", e));
+                 ("coyoteConnector.protocolHandlerStopFailed"), e);
         }
 
         mapperListener.stop();
@@ -974,7 +974,7 @@ public class Connector extends Lifecycle
         } catch (Exception e) {
             throw new LifecycleException
                 (sm.getString
-                 ("coyoteConnector.protocolHandlerDestroyFailed", e));
+                 ("coyoteConnector.protocolHandlerDestroyFailed"), e);
         }
 
         if (getService() != null) {

Modified: tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1042798&r1=1042797&r2=1042798&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Mon Dec  6 21:25:07 2010
@@ -18,10 +18,10 @@
 # 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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org