试图理解OSGi分辨率错误



我对OSGi相当陌生,我遇到了一个非常简单的初学者错误。

当我将捆绑激活器添加到我的捆绑包时,出现以下解决方法错误:

[INFO] Building jar: C:projectsosgi.enroute-masterprojectstestprojectapptargetapp-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- bnd-indexer-maven-plugin:4.0.0:index (index) @ app ---
[INFO]
[INFO] --- bnd-indexer-maven-plugin:4.0.0:index (test-index) @ app ---
[INFO]
[INFO] --- bnd-export-maven-plugin:4.0.0:export (default) @ app ---
[ERROR] Resolution failed. Capabilities satisfying the following requirements could not be found:
[<<INITIAL>>]
? osgi.identity: (osgi.identity=org.foo.examples.service.impl)
? [org.foo.examples.service.impl version=0.0.1.201806070724]
? osgi.wiring.package: (&(osgi.wiring.package=org.osgi.framework)(&(version>=1.9.0)(!(version>=2.0.0))))
? [org.osgi.framework version=1.9.0.201802012106]
? osgi.wiring.package: (&(osgi.wiring.package=org.osgi.dto)(&(version>=1.1.0)(!(version>=2.0.0))))
The following requirements are optional:
[org.apache.felix.scr version=2.1.0]
? osgi.wiring.package: (&(osgi.wiring.package=org.osgi.service.cm)(&(version>=1.6.0)(!(version>=2.0.0))))
? osgi.wiring.package: (&(osgi.wiring.package=org.apache.felix.service.command)(&(version>=1.0.0)(!(version>=2.0.0))))
? osgi.wiring.package: (&(osgi.wiring.package=org.apache.felix.shell)(&(version>=1.0.0)(!(version>=1.1.0))))
? osgi.wiring.package: (&(osgi.wiring.package=org.osgi.service.log)(&(version>=1.3.0)(!(version>=2.0.0))))
? osgi.wiring.package: (&(osgi.wiring.package=org.osgi.service.metatype)(&(version>=1.2.0)(!(version>=2.0.0))))

我在GitHub上使用OSGi enRoute示例,该示例使用maven插件和自定义原型来设置项目和不同类型的捆绑包。它还使用 Bndtools,据我所知,它应该自动解决这些类型的捆绑依赖关系。我不能排除在OSGi依赖问题之下还有一个Maven依赖。

是否有关于如何解析和理解此类错误的文档?

我知道这个问题很模糊,我目前甚至缺乏理解,甚至无法精确地提出问题:)

对于分辨率错误,您首先查看失败的最内层分辨率。在您的情况下,它是:

osgi.wiring.package: (&(osgi.wiring.package=org.osgi.dto)(&(version>=1.1.0)(!(version>=2.0.0))))

这可以翻译,您缺少一个捆绑包,该捆绑包提供包"org.osgi.dto"的导出,版本为 [1.1.0,2.0.0]。此套餐由

https://mvnrepository.com/artifact/org.osgi/org.osgi.dto

因此,您可以尝试安装此捆绑包。

最新更新