Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top