jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-1598) Problematic exception handling in Jackrabbit WebApp
Date Tue, 13 May 2008 12:50:55 GMT
Problematic exception handling in Jackrabbit WebApp
---------------------------------------------------

                 Key: JCR-1598
                 URL: https://issues.apache.org/jira/browse/JCR-1598
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-webapp
            Reporter: Thomas Mueller
            Priority: Minor


In this project, the cause of the exception is often ignored, and only the message of the
cause is used, as in:

} catch (Exception e) {
    log.error("Error in configuration: {}", e.toString());
    throw new ServletException("Error in configuration: " + e.toString());
}

An additional problem is that when using ServletException(String message, Throwable rootCause),
the rootCause is not used in printStackTrace(), that means the cause is not logged. See also:
http://closingbraces.net/2007/11/27/servletexceptionrootcause/

It is therefore better to convert 
  throw new ServletException("Unable to create RMI repository. jcr-rmi.jar might be missing.",
e);
to
  ServletException s = new ServletException("Unable to create RMI repository. jcr-rmi.jar
might be missing.");
  s.initCause(e);
  throw s;






-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message