[英]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.您好我无法访问我的项目的内容,我已经上传了从 CQ 访问内容所需的所有包。 Only thing I can see is
我唯一能看到的是
org.apache.sling.api.resource,version=[2.3,3) -- Cannot be resolved
org.apache.sling.api.resource,version=[2.3,3) -- 无法解析
Can this be the reason for exception and if yes please let me know how to resolve it.这可能是例外的原因吗?如果是,请告诉我如何解决。
CQ version 5.6 CQ 5.6版
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.该错误消息意味着 OSGi 框架无法为要导入它的包 B 提供
org.apache.sling.api.resource
Java 包的版本 >= 2.3 和 < 3。
As a result, bundle B cannot be activated, and parts of your system won't work.因此,无法激活捆绑包 B,并且您的系统的某些部分将无法工作。
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.查看 webconsole(在 Sling 和 CQ 中默认位于
/system/console
下),您可以看到此包由org.apache.sling.api bundle
,因此要么您的系统中有该包的旧版本,或者您安装了不兼容的包,需要该包的更新版本。
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
访问项目core/pom.xml的 core 文件夹中的 pom.xml 文件,并在Import-Package 下列出依赖项
<configuration>
<bnd><![CDATA[
Import-Package:
javax.annotation;version=0.0.0,
org.apache.sling.api.servlets;version="[2.3,3)",*
]]></bnd>
</configuration>
Check version of org.apache.sling.api.resource in package-info.class file in org.apache.sling.api.resource package in uber-jar.在 uber-jar 中的 org.apache.sling.api.resource package 中的 package-info.class 文件中检查 org.apache.sling.api.resource 的版本。
You might have version between 2.3 and 3. Try installing lower version uber-jar that has package version <2.3您的版本可能介于 2.3 和 3 之间。尝试安装具有 package 版本 <2.3 的较低版本的 uber-jar
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.