Expand my Community achievements bar.

Intermittent JSP compilation errors

Avatar

Level 3

Hi all,

I have AEM 6.1 SP2 CFP11 running on the linux server and we get the below error after the package deployment mostly and it seems to be intermittent sometimes on author and sometimes on author.

Error on the page:         

Unresolved compilation problems: Only a type can be imported. com.x.y.ClassName resolves to a package.

We do have the OSGi bundle active and running without any dependency errors.

Below is the error trace:

org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 47 in the generated java file

Only a type can be imported. com.x.y.z.ClassName resolves to a package

An error occurred at line: 48 in the generated java file

Only a type can be imported. com.x.y.z.AnotherClassName resolves to a package

        at org.apache.sling.scripting.jsp.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)

        at org.apache.sling.scripting.jsp.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)

        at org.apache.sling.scripting.jsp.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:136)

        at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:312)

        at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:290)

        at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:277)

        at org.apache.sling.scripting.jsp.jasper.JspCompilationContext.compile(JspCompilationContext.java:501)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.prepareServlet(JspServletWrapper.java:427)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:486)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)

Troubleshooting steps: (doesnt seem to work all the times)

Restarting the bundle

Reinstalling the bundle

sling jsp recompile

Restarting AEM instance

Any help regarding this would be much appreciated.

Thanks in Advance,

Arun

5 Replies

Avatar

Level 10

This suggests that the JSP cannot find the Service. When you open up the Service view, do you see your service?

http://localhost:4502/system/console/services

Avatar

Level 3

I could see my bundle under the /system/console/bundles

Also "always" this bundle is not getting installed when i do it via the package manager(although the same package is working on other environment) and i had to do it manually in the web console for author and for publisher only the error pops up intermittently and it wont go whatever we do and it resolves on its own or after the jsp recompilation.

Am trying to find the root cause and what are the standard steps to resolve it.

Avatar

Level 10

If this package is working on the other server - sounds like the issue is with the server. Are you seeing other strange behaviour with this AEM instance?