[jboss-jira] [JBoss JIRA] Commented: (JBWEB-211) Jasper Parser drops exception root cause
Andrew Sacamano (JIRA)
jira-events at lists.jboss.org
Wed Sep 14 17:31:26 EDT 2011
[ https://issues.jboss.org/browse/JBWEB-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628518#comment-12628518 ]
Andrew Sacamano commented on JBWEB-211:
---------------------------------------
One solution that worked for us was to rebuild jbossweb.jar (from EAP 5.1.0) with a fixed Parser class based on the JBoss Web 2.1.9GA source (couldn't find 2.1.10), replacing line 342 with this:
342 err.jspError(parent, ex.getMessage(), null, ex);
Once we did that, it took 5 minutes to solve a problem that the team had been working on for two days.
> 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
> Labels: exception_handling
>
> 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