无法解析捆绑包修订,因为它通过两个依赖关系链暴露给包

时间:2017-04-02 14:07:43

标签: java osgi cq5 aem osgi-bundle

我的代码 - >包装X(第三方包装) - > org.apache.commons.lang 2.6.0
我的代码 - >包装Y(第三方包装) - > org.apache.commons.lang 2.4

我无法控制包X包或包Y包。

这是我的错误:

02.04.2017 08:02:12.315 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask Unable to start bundle com.mynews.my-wcm-bundle [394] : Uses constraint violation. Unable to resolve bundle revision com.mynews.my-wcm-bundle [394.11] because it is exposed to package 'org.apache.commons.lang.math' from bundle revisions com.mynews.my-wcm-dependencies-bundle [395.39] and com.day.commons.osgi.wrapper.commons-lang2 [45.0] via two dependency chains.

**Chain 1:**
  com.mynews.my-wcm-bundle [394.11]
    import: (&(osgi.wiring.package=org.apache.commons.lang.math)(version>=2.6.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=org.apache.commons.lang.math
  com.mynews.my-wcm-dependencies-bundle [395.39]

**Chain 2:**
  com.mynews.my-wcm-bundle [394.11]
    import: (osgi.wiring.package=com.day.cq.security)
     |
    export: osgi.wiring.package=com.day.cq.security; uses:=com.day.cq.commons
  com.day.cq.cq-security-api [283.0]
    import: (osgi.wiring.package=com.day.cq.commons)
     |
    export: osgi.wiring.package=com.day.cq.commons; uses:=org.apache.commons.lang.time
  com.day.cq.cq-commons [264.0]
    import: (&(osgi.wiring.package=org.apache.commons.lang.time)(version>=2.4.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=org.apache.commons.lang.time; uses:=org.apache.commons.lang.math
    export: osgi.wiring.package=org.apache.commons.lang.math
  com.day.commons.osgi.wrapper.commons-lang2 [45.0]

1 个答案:

答案 0 :(得分:2)

如果你看链条,你可以看到一个包需要公共语言版本[2.4,3]而另一个包需要版本[2.6,3]。因此,如果您确定只安装了公共资源,那么您的资产包应该解决。