Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
harishred
Level 2

14-03-2020

Hello all, trying to build my project and getting below error in my OSGi... (Project created by archetype 23)

 

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 in 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 

 

AEM 6.5 Archetype osgi sling

Replies

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

31-03-2020

What AEM version are you using?

Avatar

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
harishred
Level 2

31-03-2020

6.5.2

Avatar

Avatar
Give Back
Level 1
RashidJ
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
RashidJ
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
RashidJ
Level 1

10-04-2021

Hello @harishred , how did you fix this? did you install any service pack or manually updated the version of sling servlet ?

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

10-04-2021

You mix up bundle version and java package version. These are 2 totally distinct concepts.

 

in AEM 6.5.5 the "SLING API" bundle in version 2.20.2 exports the package "org.apache.sling.api.servlets" in the version 2.3.0. When you check in the OSGI webconsole and search for the Sling API bundle and display the details, it will show you the bundle exports plus the respective versions. 

 

You should not be required to change anything in your POM, when you want to use this API, just having the uber.jar in the matching version to your AEM instance used should be sufficient.

Avatar

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
harishred
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
harishred
Level 2

12-04-2021

Issue was with Archetype 23 which was not supported by dependencies in POM.. changed to 22 and it worked.. whatever archetype you are facing, go down 1 and try. Else issue with your dependencies  

Avatar

Avatar
Give Back
Level 1
RashidJ
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
RashidJ
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
RashidJ
Level 1

29-04-2021

Hi, I upgraded the uber jar version to 6.5.0 in my project and it fixed the issue. thank you!