[jboss-jira] [JBoss JIRA] Created: (JBWEB-211) Jasper Parser drops exception root cause

Andrew Sacamano (JIRA) jira-events at lists.jboss.org
Wed Sep 14 16:19:26 EDT 2011


Jasper Parser drops exception root cause
----------------------------------------

                 Key: JBWEB-211
                 URL: https://issues.jboss.org/browse/JBWEB-211
             Project: JBoss Web
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Tomcat
    Affects Versions: JBossWeb-2.1.9.GA
         Environment: All
            Reporter: Andrew Sacamano
            Assignee: Remy Maucherat
            Priority: Minor


Line 342 in of java/org/apache/jasper/compiler/Parser.java (see below) commits one of the cardinal sins of exception handling - it drops the original stack trace, and original root causes.

This has contributed to the premature grey hair of one of our sysadmins, as he tries to sort out why a particular tag is causing the JSP compiler to puke.

 327
 328     /*
 329      * Invokes parserController to parse the included page
 330      */
 331     private void processIncludeDirective(String file, Node parent)
 332             throws JasperException {
 333         if (file == null) {
 334             return;
 335         }
 336
 337         try {
 338             parserController.parse(file, parent, jarFileUrl);
 339         } catch (FileNotFoundException ex) {
 340             err.jspError(start, "jsp.error.file.not.found", file);
 341         } catch (Exception ex) {
 342             err.jspError(start, ex.getMessage());
 343         }
 344     }
 345

It looks like there is a bit of work involved to craft a better response, perhaps adding another jspError variant - but surely the actual exception is important enough to go through the effort.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list