ICEfaces
  1. ICEfaces
  2. ICE-1679

ParserUtils.java is hiding a useful error message contained within the SAXException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#5
    • Fix Version/s: 1.6.2, 1.7DR#1, 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP / Tomcat 5.5.17

      Description

      Recommend changing line 107 from this:
                          (Localizer.getMessage("jsp.error.parse.xml", uri), sx);

      To this:
                          (Localizer.getMessage("jsp.error.parse.xml", uri) + " - SAXException: " + sx.getMessage(), sx);

      Because when a ParseException occurs within the ParserUtils.parseXMLDocument() method, the sx.getMessage() can be very helpful in understanding what caused the exception to be thrown. As the code stands now, the message is ignored.


      Neil

        Activity

        Hide
        Ted Goddard added a comment -

        Backported to icefaces-1.6 branch.

        Show
        Ted Goddard added a comment - Backported to icefaces-1.6 branch.
        Hide
        Ted Goddard added a comment -

        Code change accepted with minor revisions. Thanks for the bug fix, Neil.

        Show
        Ted Goddard added a comment - Code change accepted with minor revisions. Thanks for the bug fix, Neil.
        Hide
        Neil Griffin added a comment -

        OK, sorry, here it is altogether (including the URI, which would also be EXTREMELY helpful):

        if (log.isErrorEnabled())

        { log.error(sx.getMessage() + " - URI=" + uri); }

        throw new JasperException
        (Localizer.getMessage("jsp.error.parse.xml", uri) + " - SAXException: " + sx.getMessage() + " - URI: " + uri, sx);

        Show
        Neil Griffin added a comment - OK, sorry, here it is altogether (including the URI, which would also be EXTREMELY helpful): if (log.isErrorEnabled()) { log.error(sx.getMessage() + " - URI=" + uri); } throw new JasperException (Localizer.getMessage("jsp.error.parse.xml", uri) + " - SAXException: " + sx.getMessage() + " - URI: " + uri, sx);
        Hide
        Neil Griffin added a comment -

        Also recommend that you log an error to the console, like this:

        if (log.isErrorEnabled())

        { log.error(sx.getMessage()); }

        Because I think all the other "catch" blocks never bother to report this error.

        Show
        Neil Griffin added a comment - Also recommend that you log an error to the console, like this: if (log.isErrorEnabled()) { log.error(sx.getMessage()); } Because I think all the other "catch" blocks never bother to report this error.
        Hide
        Neil Griffin added a comment -

        This issue is related to this one:
        http://jira.icefaces.org/browse/ICE-1681

        In that if the scenario described in ICE-1681 occurs, then this issue becomes relevant.

        Show
        Neil Griffin added a comment - This issue is related to this one: http://jira.icefaces.org/browse/ICE-1681 In that if the scenario described in ICE-1681 occurs, then this issue becomes relevant.

          People

          • Assignee:
            Unassigned
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: