Expand my Community achievements bar.

SOLVED

[Error] Maven Dependency on commerce api on AEM 6.1

Avatar

Level 2

I have some trouble on declaring the dependency of commerce api on AEM 6.1 as per my http://localhost:4502/system/console/depfinder the following maven dependency should be used:

 

<dependency> <groupId>com.adobe.cq.commerce</groupId> <artifactId>cq-commerce-core</artifactId> <version>5.13.12</version> <scope>provided</scope> </dependency>

 

but I get the following error : " Failure to find com.adobe.cq.commerce:cq-commerce-core:jar:5.13.12 in http://repo.adobe.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of adobe has elapsed or updates are forced"

I already declared the following maven dependency as per the Stackoverflow question but still getting the same error message:

 

<depen­dency> <groupId>com.adobe.aem</groupId> <arti­fac­tId>uber-jar</arti­fac­tId> <ver­sion>6.1.0</ver­sion> <scope>pro­vided</scope> <clas­si­fier>obfuscated-apis</clas­si­fier> </depen­dency>
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The error you now see is because of the limitation of the obfuscated uber jar file. The obfuscated file was created so that you can compile your code by just adding one dependency in your pom file. However, since it is obfuscated it does not have the full implementation code but only a skeleton code needed for compiling your classes. 

To solve this problem you need to get the full or un-obfuscated uber jar file which has the complete byte code. You can request it from Adobe daycare (its not in public Adobe maven repository) and then just add it to your internal maven repository. You need to include in your pom file like this-

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.1.0</version> <classifier>apis</classifier> <scope>provided</scope> </dependency>

[1] https://docs.adobe.com/docs/en/aem/6-1/develop/dev-tools/ht-projects-maven.html#You%20mentioned%20an...

YOU MENTIONED AN EXCEPTION TO SCR GENERATION. PLEASE EXPLAIN FURTHER.

The one significant limitation of the obfuscated UberJar with respect to SCR Generation is that SCR XML files cannot be generated for components which extends an obsfucated abstract class. For example, if you have a workflow process which extends com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess, that will not currently work. You will need the unobsfucated version. We continue to evaluate the impact of this issue and are assessing possible solutions

See this thread as well - http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

View solution in original post

8 Replies

Avatar

Level 9

Hey Harold,

What is the remote repository you are using?. Also, Can you remove this commerce folders from local cache (Bit cleans up)?.

Jitendra

Avatar

Employee Advisor

On 6.1 , you should only add the uber-jar as a dependency in your pom as the ecommerce API is included within uber-jar. Remove the com.adobe.cq.commerce dependency from your pom file and rebuild again. 

Avatar

Level 2

Thank you for comments kunal23 and Jitendra. I followed your suggestions and the following error has been displayed:

 

 "Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (generate-scr-descriptor) on project Allphones-Ecommerce-website-bundle: 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/commerce/common/AbstractJcrCommerceService.<init>(Lcom/adobe/cq/commerce/common/AbstractJcrCommerceServiceFactory$Services;)V @1: return
[ERROR] Reason:
[ERROR] Error exists in the bytecode
[ERROR] Bytecode:
[ERROR] 0x0000000: 2ab1
[ERROR]
[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: ../.m2/repository/org/apache/felix/maven-scr-plugin/1.7.4/maven-scr-plugin-1.7.4.jar
[ERROR] urls[1] = file: ../.m2/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
[ERROR] urls[2] = file: ../.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] urls[3] = file: ../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[4] = file: ../.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[5] = file: ../.m2/repository/org/apache/felix/org.apache.felix.scr.generator/1.1.4/org.apache.felix.scr.generator-1.1.4.jar
[ERROR] urls[6] = file: ../.m2/repository/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar
[ERROR] urls[7] = file: ../.m2/repository/asm/asm-all/3.1/asm-all-3.1.jar
[ERROR] Number of foreign imports: 1
"

Avatar

Level 2

If I am not mistaken there are no available document tutorial for the integration of Commerce API to AEM 6.1 just like this document. Right?

Avatar

Level 9

Well,

You are right in a way. Actually, Adobe says the AEM eCommerce native platform is just for sample. I believe, Much more work needs to be done on this front. Having said that some of the things are still possible. And it depends on what do you want to build?.

If you want to just use this Native eCommerce framework, you might be needing more development & customization without much help. For instance, Generating product pages, Maintaining catalog pages & templates, product search, user management with security concerns, transactions stuff etc.

Jitendra

Avatar

Correct answer by
Employee Advisor

The error you now see is because of the limitation of the obfuscated uber jar file. The obfuscated file was created so that you can compile your code by just adding one dependency in your pom file. However, since it is obfuscated it does not have the full implementation code but only a skeleton code needed for compiling your classes. 

To solve this problem you need to get the full or un-obfuscated uber jar file which has the complete byte code. You can request it from Adobe daycare (its not in public Adobe maven repository) and then just add it to your internal maven repository. You need to include in your pom file like this-

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.1.0</version> <classifier>apis</classifier> <scope>provided</scope> </dependency>

[1] https://docs.adobe.com/docs/en/aem/6-1/develop/dev-tools/ht-projects-maven.html#You%20mentioned%20an...

YOU MENTIONED AN EXCEPTION TO SCR GENERATION. PLEASE EXPLAIN FURTHER.

The one significant limitation of the obfuscated UberJar with respect to SCR Generation is that SCR XML files cannot be generated for components which extends an obsfucated abstract class. For example, if you have a workflow process which extends com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess, that will not currently work. You will need the unobsfucated version. We continue to evaluate the impact of this issue and are assessing possible solutions

See this thread as well - http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

Avatar

Level 2

This issue is to do with the uber jar.