Skip to main content
Level 3
Mar 16, 2020 1:14 PM UTC
Solved

Error - org.apache.sling.api.servlets cannot be resolved

Hello all, trying to build my project and getting below error in my OSGi after deploying it as a bundle... (Project created by archetype 23).. I am seeing below error:

org.apache.sling.api.servlets,version=[2.3,3) -- Cannot be resolved

I have this dependency added in my POM

 

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.api</artifactId> <version>2.3.0</version> <scope>provided</scope> </dependency>

 

Tried all versions https://repo.adobe.com/nexus/content/groups/public/org/apache/sling/org.apache.sling.api/ but no luck. What am I missing?

 

Error from logs:

14.03.2020 22:36:12.200 *ERROR* [qtp1524159769-1650] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unable to resolve akamdashapi.core [585](R 585.1): missing requirement [akamdashapi.core [585](R 585.1)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api.servlets)(version>=2.3.0)(!(version>=3.0.0))) Unresolved requirements: [[akamdashapi.core [585](R 585.1)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api.servlets)(version>=2.3.0)(!(version>=3.0.0)))])
org.osgi.framework.BundleException: Unable to resolve akamdashapi.core [585](R 585.1): missing requirement [akamdashapi.core [585](R 585.1)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api.servlets)(version>=2.3.0)(!(version>=3.0.0))) Unresolved requirements: [[akamdashapi.core [585](R 585.1)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api.servlets)(version>=2.3.0)(!(version>=3.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)

@kautuk_sahni @Jörg_Hoh @Arun_Patidar 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
chrisatsirius
chrisatsiriusAccepted solution
Level 2
Mar 19, 2020 3:07 AM UTC

get service pack 4(6.5.4), it should fix your issue.

 

11 replies

harishredAuthor
Level 3
Mar 16, 2020 5:56 PM UTC
When i used archetype 22, i dont see this issue.. looks like the issue is only with 23
Translate
Vijayalakshmi_S
Level 10
Mar 16, 2020 6:40 PM UTC

Hi,

 

Please look for the "Exported Packages" list of the bundle - Apache Sling API (org.apache.sling.api) in your instance.

We will have the servlets API mentioned with version as one among the list.

  • Make an entry of the same explicitly in the "Import-Package" list of bundle plugin in core/pom.xml

Also, the maven dependency to be added can be arrived at using system/console/depfinder.html which will be  - the whole of sling API bundle that exposes the servlets API.

 

Translate
harishredAuthor
Level 3
Mar 16, 2020 8:23 PM UTC
Hi @vijis, thank you. I've tried that already as you can see in my question.. infact its 2.2.1 like you have in your instance. and i added the maven dependency as well with no luck.
Translate
arunpatidar
Community Advisor
Community Advisor
Mar 18, 2020 5:15 PM UTC

Can you check what version of org.apache.sling.api.servlets you have in aem.

You can check using /system/console/depfinder

 

In AEM 6.5 It is 2.2.1

 

Please check https://stackoverflow.com/questions/20278236/org-apache-sling-api-resource-version-2-3-3-cannot-be-resolved

 

Translate
Arun Patidar
harishredAuthor
Level 3
Mar 18, 2020 5:29 PM UTC

Hi Arun, yes already checked that link you gave 🙂 .. the version i have is also 2.2.1

 

Translate
chrisatsirius
chrisatsiriusAccepted solution
Level 2
Mar 19, 2020 3:07 AM UTC

get service pack 4(6.5.4), it should fix your issue.

 

Translate
harishredAuthor
Level 3
Mar 19, 2020 3:10 AM UTC
Yeah makes sense, i dont have access to the jar, but probably will request it later.. Prod is on 6.5.2 so doesnt make getting 6.5.4.. Hope archetype version had Aem versions it supports
Translate