Up gradation of code base from AEM 6.1 to 6.4 (Upgrade WCMUse to WCMUsePojo)




As I am trying to upgrade from AEM 6.1 to AEM 6.4, I need to change the extension of all the classes from WCMUse to WCMUsePojo. Have added the required dependency in the projects parent pom.xml as well :








But I am getting the following error during the maven build of the project:

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (generate-scr-descriptor) on project abcd: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.4:scr: java.lang.VerifyError: Constructor must call super() or this() before return

[ERROR] Exception Details:

[ERROR] Location:

[ERROR] com/adobe/cq/sightly/WCMUsePojo.<init>()V @1: return

[ERROR] Reason:

[ERROR] Error exists in the bytecode

[ERROR] Bytecode:

[ERROR] 0x0000000: 2ab1


[ERROR] -----------------------------------------------------

[ERROR] realm =    plugin>org.apache.felix:maven-scr-plugin:1.7.4

[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] urls[0] = file:/D:/aem_local_repo/org/apache/felix/maven-scr-plugin/1.7.4/maven-scr-plugin-1.7.4.jar

[ERROR] urls[1] = file:/D:/aem_local_repo/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar

[ERROR] urls[2] = file:/D:/aem_local_repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar

[ERROR] urls[3] = file:/D:/aem_local_repo/junit/junit/3.8.1/junit-3.8.1.jar

[ERROR] urls[4] = file:/D:/aem_local_repo/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar

[ERROR] urls[5] = file:/D:/aem_local_repo/org/apache/felix/org.apache.felix.scr.generator/1.1.4/org.apache.felix.scr.generator-1.1.4.jar

[ERROR] urls[6] = file:/D:/aem_local_repo/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar

[ERROR] urls[7] = file:/D:/aem_local_repo/asm/asm-all/3.1/asm-all-3.1.jar

[ERROR] Number of foreign imports: 1

[ERROR] import: Entry[import  from realm ClassRealm[project> abcd:1.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]


[ERROR] -----------------------------------------------------

[ERROR] -> [Help 1]


[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.


[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException


[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :

Also I have a doubt if it is compatible to use Maven Archtype 11 in AEM 6.4

View Entire Topic




If you plan to keep SCR annotations in 6.4 then update the jar versions. e.g. try using 1.20.0 or above for maven-scr-plugin and 1.9.0 for scr-annotations. Similar approach goes for compile time dependencies/plugins like 'servlet-api' etc.

A clean & time saving approach would be to use maven archetype and create a new project from scratch if that's feasible.

You could also choose a hit n trial approach - create a reference project using maven archetype and then utilize specific jar/versions into your existing project as required.

As Nirmal mentioned above, if you plan to utilize OSGI annotations, then update osgi related artifacts & versions.