Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1598

Problematic exception handling in Jackrabbit WebApp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5
    • jackrabbit-webapp
    • None

    Description

      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;

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            thomasm Thomas Mueller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: