AEM - Bundles not resolving with Archetype archetypeVersion=35 | org.apache.sling.api.request,version=[2.6,3) -- Cannot be resolved

#AEMGyaan time 😊 Just a quick one, in case you are also facing the same issue. I was recently trying to create a new project with archetype 35 for Cloud. When the package was built and installed, the bundles didn't resolve. The bundle is throwing the below error.

org.apache.sling.api.request,version=[2.6,3) -- Cannot be resolved

No alt text provided for this image

Root Cause

When your new project is built using the archetype 35 for Cloud, every dependency is downloaded for the aem.sdk.api version mentioned in your pom.xml

No alt text provided for this image

So as per this version of cloud , the org.apache.sling.api.request,version is [2.6,3). But if the local cloud version you are using is lesser than the above version, then your bundles will not resolve and will throw the above error. So how can you resolve this 🤔🤔

Solution

  1. Go to the product information of your local host via http://localhost:4502/system/console/productinfo

No alt text provided for this image

2. Copy the version and paste it into your pom.xml

No alt text provided for this image

3. This is not the end, but let's build and check. 😉.

Oopsie... The build failed 🤔🤔🙄

No alt text provided for this image

So the problem here is the number after the hyphen (-). So every version has a different number after this hyphen which is specific for the jars related to these versions. Now how do you find this number for your cloud version 🤔🤔 !?

Who else to ask for... GOOGLE 😁😁

No alt text provided for this image

If you are lucky, Google will tell you the last 6 digits you need for this version. (Sorry guys, I don't know if we have any other way to find it. 😑😑. )

Replace this number and build your project

No alt text provided for this image
No alt text provided for this image

4. Install the package and check the system/console

Now your bundle should be active and with the right version for your current cloud version of AEM

No alt text provided for this image

Hope this helps. As usual, keep rocking and keep learning 😊😊

Thanks for the post. Your solution was exactly what I needed.

Mallik Vamaraju

Technical Architect at Adobe

9mo

Worked like a charm!

The AEM cloud project is being downgraded to AEM 6.5. Certain dependencies still need to be addressed. Kindly help me on this Regards, Jhansi

  • No alternative text description for this image
Like
Reply
Ramkumar Pandian

Senior Developer - AEM | Java | Microservices

1y

Thank you Veena Vikraman. I had the same issue with archetype 40 & 41 for cloud version, and I followed the same steps as you have mentioned, but I think I found another way to find the exact version. 1. Copy & paste the aem.sdk version in Google. 2. Go for the result which has a link to the maven central repo. 3. find the entry in the list of entries in maven repo 4. It has a six digit number after the dash - I added the same to my pom.xml and it fixed the issue. Hope this helps!

  • No alternative text description for this image
Linu Joseph

Ex-Adobe . AEM 6.2(on premises) • AEM 6.5(cloud | on premises) • Dispatcher Configurations. Java • Spring Boot • Micro services • REST API • SOAP • SAP Integration • E-comerce • Git • Project Management • Jira

2y

What about the same issue in on premises?

Like
Reply

To view or add a comment, sign in

More articles by Veena Vikraman

Insights from the community

Others also viewed

Explore topics