[ 
https://issues.apache.org/jira/browse/SLING-571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622187#action_12622187
 ] 

Alexander Klimetschek commented on SLING-571:
---------------------------------------------

Experienced the same issue when a jsp had compilation errors that got 
completely swallowed. The NPE above was only 1 of 3 issues that were roadblocks:

2) There is also a NPE in the ErrorDispatcher.createJavacError() method, where 
the passed "page" parameter can be null (ie. if there was a script compile 
error and the parsed script tree = page is null).

3) And finally the javax.script.ScriptException (eg. here 
http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/ScriptException.java?view=markup)
 swallows the message of the causing exception when using the constructor with 
just the causing exception (in JspScriptEngineFactory.JspScriptEnginge.eval()).

> JspServletWrapper swallows jsp exceptions if root cause is null
> ---------------------------------------------------------------
>
>                 Key: SLING-571
>                 URL: https://issues.apache.org/jira/browse/SLING-571
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP 2.0.2
>            Reporter: Tobias Bocanegra
>         Attachments: SLING-571.patch
>
>
> For example for a JSP compile error the 'realException' is null and the 
> following stack-frame resolution fails:
> (JspServletWrapper.java, line 492ff)
>             // First identify the stack frame in the trace that represents 
> the JSP
>             StackTraceElement[] frames = realException.getStackTrace();
>             StackTraceElement jspFrame = null;
>             for (int i=0; i<frames.length; ++i) {
>                 if ( 
> frames[i].getClassName().equals(this.getServlet().getClass().getName()) ) {
>                     jspFrame = frames[i];
>                     break;
>                 }
>             }
> Suggest to check for (realException == null)

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

Reply via email to