


Arun_007
Arun_007
07-02-2018
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
Hemant_arora
Hemant_arora
08-02-2018
try changing the package path
smacdonald2008
smacdonald2008
08-02-2018
This suggests that the JSP cannot find the Service. When you open up the Service view, do you see your service?
Arun_007
Arun_007
12-02-2018
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.
smacdonald2008
smacdonald2008
12-02-2018
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?
Arun_007
Arun_007
19-02-2018
No other strange behaviors identified.