ankit
ankit

Reputation: 5127

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

Hi I am not able to access content of my project, I have uploaded all the packages which are required to access content from CQ. Only thing I can see is

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

Can this be the reason for exception and if yes please let me know how to resolve it.

CQ version 5.6

Upvotes: 2

Views: 11469

Answers (3)

srihitha
srihitha

Reputation: 489

Check version of org.apache.sling.api.resource in package-info.class file in org.apache.sling.api.resource package in uber-jar.

enter image description here

You might have version between 2.3 and 3. Try installing lower version uber-jar that has package version <2.3

Upvotes: 0

Luis Felix
Luis Felix

Reputation: 1

You can add the missing package by explicilty importring it. Accecess the pom.xml file in the core folder of your project core/pom.xml and list the dependency under Import-Package

<configuration>
    <bnd><![CDATA[
        Import-Package: 
            javax.annotation;version=0.0.0,
            org.apache.sling.api.servlets;version="[2.3,3)",*
     ]]></bnd>
</configuration>

Upvotes: 0

Bertrand Delacretaz
Bertrand Delacretaz

Reputation: 6100

The error message means that the OSGi framework is unable to supply a version >= 2.3 and < 3 of the org.apache.sling.api.resource Java package for a bundle B that wants to import it.

As a result, bundle B cannot be activated, and parts of your system won't work.

Looking at the webconsole (under /system/console by default in Sling and CQ) you can see that this package is provided by the org.apache.sling.api bundle, so either you have an old version of that bundle in your system, or you have installed incompatible bundles that require a newer version of that package.

Upvotes: 3

Related Questions