我有一个用 Java 8 编写的 RCP 应用程序,我可以使用 Eclipse Mars IDE 构建和运行它,没有任何问题。现在我需要将 Tycho 0.24.0 集成到我的项目中。我可以使用 Tycho 成功构建项目,但遇到运行时问题。例如,我的大多数 OSGI 包都依赖于 blueprint-cm
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
<ext:property-placeholder placeholder-prefix="$["
placeholder-suffix="]"/>
<cm:property-placeholder persistent-id="com.mst.fusion.osgi" />
</blueprint>
问题是由于缺少 ConfigurationAdmin,无法解析 org.apache.aries.blueprint.cm 包。请查看OSGI控制台的日志
DEBUG o.a.a.b.c.AbstractServiceReferenceRecipe - Found initial references null for OSGi service (objectClass=org.osgi.service.cm.ConfigurationAdmin)
INFO o.a.a.b.c.BlueprintContainerImpl - Bundle org.apache.aries.blueprint.cm is waiting for dependencies [(objectClass=org.osgi.service.cm.ConfigurationAdmin)]
ERROR o.a.a.b.c.BlueprintContainerImpl - Unable to start blueprint container for bundle org.apache.aries.blueprint.cm due to unresolved dependencies [(objectClass=org.osgi.service.cm.ConfigurationAdmin)]
java.util.concurrent.TimeoutException: null
如何创建 ConfigurationAdmin 服务?
greg-449的提示。事实证明,我有 org.osgi.service.cm.ConfigurationAdmin 接口,但我没有任何可用的实现,我只是从 Mars 存储库手动下载了 org.eclipse.equinox.cm jar,现在它可以工作了。