We have recently upgraded from AEM 5.6.1 to AEM 6.2 on java 7. Now we are in middle of upgrading our java version as well. When we upgrade to Java 8 and build, the java classes are getting compiled fine. but jsp files are getting below errors
The same code seems to work on java 7. We tried searching for same over web but people have mentioned solutions w.r.t eclipse jre update. In our case build is failing when maven-jspc-plugin is trying to compile the jsp files. If we exclude the plugin, the build works fine but this can not be excluded since it hints out possibility of error during compile time instead of seeing error on CQ5 pages.
1. locate "Apache Sling Commons FileSystem ClassLoader" in /system/console/bundles
2. on the filesystem go to crx-quickstart/launchpad/felix
3. go to bundle<id-from-step1>
4. stop AEM
5. remove data/classes
6. start AEM
Thanks Feike Visser for the reply.
But we are getting error when we are doing COMPILATION , command "mvn clean install" .
Actually it is happening before installing in AEM .
When we compile with java1.7 it is working fine but when we compile with java1.8 this error is coming (JSP compilation).
One more point : The compiled code with 1.7 have no issues and successfully running in AEM 6.1/6,2 which is running on JAVA1.8 .
So only the problem with compilation.
"mvn clean install" is typically not compiling JSPs, unlike you have the jspc plugin doing it.
When you say "upgrading to Java 8", do you mean you upgrade the build to Java 8 or do you refer to the runtime (that means the JVM version you use to run AEM)? At best you use both at Java 8.
As mentioned in initial description by @khannapiyush36 , we are also using maven-jspc-plugin for compilation.
The build with Java 8 is giving those errors (failing).
AEM is successfully running on JAVA8 .
note: Local JAVA_HOME set to JAVA1.8 only.
To deploy our code , we have to build code using maven , while doing the compilation , getting those errors (same as mentioned in the initial description of this forum topic) and build is failing.
That's indeed very strange. I assume that you are using a JDK and not a JRE for building.
Have you updated the JSPC plugin to the latest version?
We have tried updating "jspc-maven-plugin" from 2.0.8 to 2.1.0 , then we get different error for other jsp's.
[ERROR] Failed to execute goal org.apache.sling:jspc-maven-plugin:2.1.0:jspc (co
mpile-jsp) on project upc-generic: Execution compile-jsp of goal org.apache.slin
g:jspc-maven-plugin:2.1.0:jspc failed: A required class was missing while execut
ing org.apache.sling:jspc-maven-plugin:2.1.0:jspc: com/fasterxml/jackson/core/Js
[ERROR] realm = plugin>org.apache.sling:jspc-maven-plugin:2.1.0
Make sure that you include a dependency to your pom which provides com.fasterxml. For AEM 6.4 it can be this:
In our parent POM , we have already below
and as you mentioned tried with version 2.8.4 also , but same error.
Hm, then it's getting weird.
I don't have experience with the JSPC plugin, so remote diagnosing your build is hard. Can you put a minimal example where this problem happens and make it available (e.g. via github), so we can have a better look at it?
Thanks for your comment and support.
But we are able to resolve the issue.
Changes done to resolve:-
1) Updated Parent POM JSPC plugin to 2.1.0 from 2.0.8
2) jackson-core and one more external (sprint freemarker) dependencies are added in App project/POM as well where we have jsp's, clentlibs with packaging plugin .
Generally/Previously these are added in CORE/POM (where we have JAVA classes including taglibs) and there was no issues, technically here only we have to mention all dependencies to compile java classes.
But when using new version of maven-jspc-plugin with JAVA1.8 , it is not able to compile the jsps (if any jsp has taglib or scriptlet code which java class has some external dependency) , so we have tried adding those specific dependencies in the App/POM also and it solved the problem
thanks for posting the resolution to your issue. In hindsight, it makes sense to add the dependency to the maven project which is using the jspc plugin :-)