1
votes

I'm trying to extend the com.day.cq.dam.core.process.ThumbnailProcess class.

I'm using Java JDK 1.8.0_65, Maven 3.0.5 and Adobe AEM 6.1

When I compile my code I get this error:

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-descriptor) on project my.pack.common.PROCESS: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.20.0:scr failed: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.20.0:scr: java.lang.VerifyError: (class: com/day/cq/dam/core/process/ThumbnailProcess, method: signature: ()V) Constructor must call super()or this()

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

[ERROR] realm = plugin>org.apache.felix:maven-scr-plugin:1.20.0 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] urls[0] = file:/C:/Users/Dwecol/.m2/repository/org/apache/felix/maven-scr-plugin/1.20.0/maven-scr-plugin-1.20.0.jar

[ERROR] urls[1] = file:/C:/Users/Dwecol/.m2/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar [ERROR] urls[2] = file:/C:/Users/Dwecol/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar [ERROR] urls[3] = file:/C:/Users/Dwecol/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar [ERROR] urls[4] = file:/C:/Users/Dwecol/.m2/repository/org/apache/felix/org.apache.felix.scr.generator/1.12.0/org.apache.felix.scr.generator-1.12.0.jar

[ERROR] urls[5] = file:/C:/Users/Dwecol/.m2/repository/org/ow2/asm/asm-all/5.0.2/asm-all-5.0.2.jar [ERROR] urls[6] = file:/C:/Users/Dwecol/.m2/repository/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.jar

[ERROR] urls[7] = file:/C:/Users/Dwecol/.m2/repository/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar

[ERROR] urls[8] = file:/C:/Users/Dwecol/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar

[ERROR] urls[9] = file:/C:/Users/Dwecol/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[project>mypro:my.pack.edidomus.common.PROCESS:1.0.1-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]] [ERROR] -> [Help 1] 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

My class is somenthing like this:

@Component
@Service
@Properties({
@Property(name = Constants.SERVICE_DESCRIPTION, value ="MyThumbnailProcess"),
@Property(name = Constants.SERVICE_VENDOR, value = "Me"),
@Property(name = "process.label", value = "My Thumbnail Proc2")}
public class MyThumbnailProc extends ThumbnailProcess {
public MyThumbnailProc(){super();}
@Override
public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaData) throws WorkflowException {
//do stuff -> create newMetaDataMap 
super.execute(workItem, workflowSession, newMetaDataMap);
}

Do you have any suggest?

2

2 Answers

0
votes

Just as a test you could try the aem6 api dependency and not the 6.1 uber jar. My guess is that you are extending an obfuscated class. If you are able to get past this with the 6.0 dependency, then you could ask Adobe for the unobfiscated 6.1 jar

<depen­dency>
         <groupId>com.adobe.aem</groupId>
        <arti­fac­tId>aem-api</arti­fac­tId>
        <ver­sion>6.0.0.1</ver­sion>
         <scope>pro­vided</scope> 
</depen­dency>
0
votes

This could be related to uber.jar and you might need unobfuscated version of the jar. You should raise a ticket with daycare, if you are not able to resolve this.