[ https://issues.apache.org/jira/browse/SLING-2704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chetan Mehrotra updated SLING-2704: ----------------------------------- Attachment: SLING-2704.patch Patch which stores the instance variables in local variables so as to avoid them getting nullified in component deactivation > NPE in JspScriptEngineFactory in case JSP bundle restart while servicing > request > -------------------------------------------------------------------------------- > > Key: SLING-2704 > URL: https://issues.apache.org/jira/browse/SLING-2704 > Project: Sling > Issue Type: Bug > Components: Scripting > Affects Versions: Scripting JSP 2.0.26 > Reporter: Chetan Mehrotra > Priority: Minor > Attachments: SLING-2704.patch > > > If a jsp perform some operation (some admin function) which results in > restart of various bundle then its possible that > org.apache.sling.scripting.jsp bundle also gets restarted. Due to which > following NPE is seen in logs. This happens because the 'jspFactoryHandler' > in JspScriptEngineFactory becomes null by the time service call returns (due > to component deactivation) > A simple fix might be to create a local copy of jspFactoryHandler and use > that (Thanks to Felix for suggesting this!!). Would attach a patch also with > the fix > Uncaught SlingException java.lang.NullPointerException > at > org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:243) > at > org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86) > at > org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441) > at > org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361) > at > org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171) > at > org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463) > at > org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508) > at > org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) > at > org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira