Unexpected JSP compilation errors in AEM 6.5.21–23 and LTS GA with org.apache.sling.scripting.jsp 2.6.0
Description description
In AEM 6.5.21–23 and AEM 6.5 LTS GA, the following errors may suddenly appear in the logs during content requests, with stack traces that include org.apache.sling.scripting.jsp:2.6.0. These error messages may also appear on the screen.
java.io.IOException: classFile.delete() failed
java.io.IOException: tmpFile.renameTo(classFile) failed
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.io.FileNotFoundException
Example stacktrace:
*ERROR* [ 0.0.0.0 [ 1747374265637] GET /content/path/to/page.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
java.io.IOException: classFile.delete() failed
at org.apache.sling.scripting.jsp.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:245) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:167) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:152) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:294) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.JspCompilationContext.compile(JspCompilationContext.java:515) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.prepareServlet(JspServletWrapper.java:444) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:505) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:464) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.callJsp(JspScriptEngineFactory.java:500) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:582) [ org.apache.sling.scripting.jsp:2.6.0]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:394) [ org.apache.sling.scripting.core:2.4.10]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:189) [ org.apache.sling.scripting.core:2.4.10]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:499) [ org.apache.sling.scripting.core:2.4.10]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:544) [ org.apache.sling.engine:2.15.18]
Resolution resolution
This is caused by a regression in org.apache.sling.scripting.jsp:2.6.0 (SLING-12442/SKYOPS-83910).
When the issue occurs, restart your AEM instance to stop the error. There is still a chance of recurrence.
The fix will be part of AEM 6.5 LTS SP1 and AEM 6.5.24. To prevent the issue on AEM 6.5 LTS GA, install cq-6.5.lts.0-hotfix-NPR-42640 from Software Distribution and restart the AEM instance. For AEM 6.5.21-23, contact Adobe Support referencing Known Issues section of the corresponding service pack releases notes, as guidance differs for AMS and on-premise environments.