The errors "Unresolved compilation problems", "cannot be resolved to a type", or "Compilation errors" are seen when viewing AEM pages and in the error.log.
For example:
31.01.2017 06:50:16.950 *ERROR* [192.150.9.201 [1485805816944] GET /content/geometrixx/en.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException java.lang.Error: Unresolved compilation problems: com.geometrixx.components.page.basepage.BasePage cannot be resolved to a type com.geometrixx.components.page.basepage.BasePage cannot be resolved to a type at org.apache.jsp.apps.geometrixx.components.page.base_002dpage.base_002dpage_jsp._jspService(base_002dpage_jsp.java:194) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
12.02.2018 12:30:52.565 *ERROR* [10.43.32.15 [1518456652560] GET /mnt/overlay/cq/gui/content/coral/common/form/tagfield/picker.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException org.apache.sling.scripting.java.impl.ServletWrapper$CompilerException: Compilation errors in /libs/cq/gui/components/coral/common/form/tagfield/datasources/children/children.java: Line 72, column 3158 : The method transform(Object) of type new Transformer(){} must override a superclass method at org.apache.sling.scripting.java.impl.ServletWrapper$CompilerException.create(ServletWrapper.java:290)
12.02.2018 12:31:23.006 *ERROR* [10.43.32.15 [1518456683001] GET /mnt/overlay/granite/ui/content/coral/foundation/form/pathfield/picker.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException org.apache.sling.scripting.java.impl.ServletWrapper$CompilerException: Compilation errors in /libs/granite/ui/components/coral/foundation/form/pathfield/datasources/children/children.java: Line 114, column 4844 : The method evaluate(Object) of type new Predicate(){} must override a superclass method Line 132, column 5667 : The method compare(Resource, Resource) of type new Comparator<Resource>(){} must override a superclass method Line 164, column 6736 : The method transform(Object) of type new Transformer(){} must override a superclass method Line 191, column 7631 : The method evaluate(Object) of type children.FolderPredicate must override a superclass method Line 208, column 8089 : The method evaluate(Object) of type children.HierarchyPredicate must override a superclass method Line 225, column 8553 : The method evaluate(Object) of type children.NoSystemPredicate must override a superclass method Line 242, column 9064 : The method evaluate(Object) of type children.HierarchyNotFilePredicate must override a superclass method Line 282, column 10387 : The method transform(Object) of type new Transformer(){} must override a superclass method at org.apache.sling.scripting.java.impl.ServletWrapper$CompilerException.create(ServletWrapper.java:290)
Here are a few possible causes:
- Missing OSGi bundles
- Stopped OSGi bundles
- Corrupt compiled jsp class files
Since the java class is exported and is available to the jsp that threw the error, then we can only suspect that the compiled jsp class files are corrupted.