OSGi 包未启动:缺少要求 osgi.wiring.package; > &(osgi.wiring.package=org.apache.felix.dm)
OSGi bundle not started : missing requirement osgi.wiring.package; > &(osgi.wiring.package=org.apache.felix.dm)
我一直在努力关注'Building Modular Cloud Apps with OSGi'。在本书 'Creating the first OSGi application' 的第 3 章中,作者描述了如何使用 bndtools 在 eclipse 中创建一个带有服务的简单 OSGi 应用程序。
下面是我的类和配置的截图。
我面临的问题是
'! could not resolve the bundles:
[agenda.service.simple-0.0.1Unresolved constraint in bundle
agenda.service.simple [9]: Unable to resolve 9.0: missing requirement
[9.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))
] ! Failed to start bundle agenda.service.simple-0.0.1, exception
Unresolved constraint in bundle agenda.service.simple [9]: Unable to
resolve 9.0: missing requirement [9.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))
____________________________'
此外,当我尝试在 gogo shell 中发出命令时,有时也无法正确输入。但最终当它出现时,捆绑状态看起来像
g! lb gogo: CommandNotFoundException: Command not found: b
g! lb gogo: CommandNotFoundException: Command not found: llb
g!
g!
g!
g!
g!
g!
lb START LEVEL 1 ID|State |Level|Name
0|Active | 0|System Bundle (4.0.3)
1|Active | 1|Apache Felix Dependency Manager (4.0.1)
2|Active | 1|Apache Felix Dependency Manager Shell (4.0.1)
3|Active | 1|Apache Felix Gogo Command (0.14.0)
4|Active | 1|Apache Felix Gogo Runtime (0.10.0)
5|Active | 1|Apache Felix Gogo Runtime (0.12.1)
6|Active | 1|Apache Felix Gogo Shell (0.10.0)
7|Active | 1|osgi.cmpn (5.0.0.201305092017)
8|Active | 1|agenda.api (0.0.0.201505171119)
9|Installed | 1|agenda.service.simple (0.0.1)
您的 agenda.service.simple 包正在寻找导出 org.apache.felix.dm 版本介于 3.0.0 和 4.0.0 之间的包,但它只找到 Apache Felix 需要的 4.0.1 版本依赖管理器导出。
通常这是由于针对与您 运行 所针对的不同版本的 felix 进行编译造成的。
Typically this would be caused by compiling against a different version of felix than you are running against.
没错,这很可能是因为Bndtools为buildpath依赖选择了最低版本(在指定的版本范围内),为runbundle选择了最高版本(在指定的版本范围内)。
在您的情况下,未指定任何范围,因此 org.apache.felix.dependencymanager 版本 3.1.0 将用于构建路径,4.0.1 将用于 运行 您的应用程序。
要使用版本 4 的依赖管理器,您可以将构建路径条目更改为:
org.apache.felix.dependencymanager;version='[4,5)'
或者要在运行时使用版本 3,您可以将 -runbundles 更改为
org.apache.felix.dependencymanager;version='[3,4)',\
org.apache.felix.dependencymanager.shell;version='[3,4)',\
我也在看上面的书。在尝试 运行 项目时,我遇到了同样的问题。出现这个问题是因为我们手动给项目提供了dependency manager .jars
,这又和项目需要的.jar
版本冲突了
我使用 Amdatu Blueprint 在高级模式下进行了新的 Eclipse 设置,并且能够获得 运行ning 项目。
您可以在下面的 link 中获取安装详细信息:
http://amdatu-repo.s3.amazonaws.com/amdatu-blueprint/r1/docs/index.html#_install_eclipse
我一直在努力关注'Building Modular Cloud Apps with OSGi'。在本书 'Creating the first OSGi application' 的第 3 章中,作者描述了如何使用 bndtools 在 eclipse 中创建一个带有服务的简单 OSGi 应用程序。
下面是我的类和配置的截图。
我面临的问题是
'! could not resolve the bundles: [agenda.service.simple-0.0.1Unresolved constraint in bundle agenda.service.simple [9]: Unable to resolve 9.0: missing requirement [9.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))
] ! Failed to start bundle agenda.service.simple-0.0.1, exception Unresolved constraint in bundle agenda.service.simple [9]: Unable to resolve 9.0: missing requirement [9.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0))) ____________________________'
此外,当我尝试在 gogo shell 中发出命令时,有时也无法正确输入。但最终当它出现时,捆绑状态看起来像
g! lb gogo: CommandNotFoundException: Command not found: b
g! lb gogo: CommandNotFoundException: Command not found: llb
g!
g!
g!
g!
g!
g!
lb START LEVEL 1 ID|State |Level|Name
0|Active | 0|System Bundle (4.0.3) 1|Active | 1|Apache Felix Dependency Manager (4.0.1) 2|Active | 1|Apache Felix Dependency Manager Shell (4.0.1) 3|Active | 1|Apache Felix Gogo Command (0.14.0) 4|Active | 1|Apache Felix Gogo Runtime (0.10.0) 5|Active | 1|Apache Felix Gogo Runtime (0.12.1) 6|Active | 1|Apache Felix Gogo Shell (0.10.0) 7|Active | 1|osgi.cmpn (5.0.0.201305092017) 8|Active | 1|agenda.api (0.0.0.201505171119) 9|Installed | 1|agenda.service.simple (0.0.1)
您的 agenda.service.simple 包正在寻找导出 org.apache.felix.dm 版本介于 3.0.0 和 4.0.0 之间的包,但它只找到 Apache Felix 需要的 4.0.1 版本依赖管理器导出。
通常这是由于针对与您 运行 所针对的不同版本的 felix 进行编译造成的。
Typically this would be caused by compiling against a different version of felix than you are running against.
没错,这很可能是因为Bndtools为buildpath依赖选择了最低版本(在指定的版本范围内),为runbundle选择了最高版本(在指定的版本范围内)。
在您的情况下,未指定任何范围,因此 org.apache.felix.dependencymanager 版本 3.1.0 将用于构建路径,4.0.1 将用于 运行 您的应用程序。
要使用版本 4 的依赖管理器,您可以将构建路径条目更改为:
org.apache.felix.dependencymanager;version='[4,5)'
或者要在运行时使用版本 3,您可以将 -runbundles 更改为
org.apache.felix.dependencymanager;version='[3,4)',\
org.apache.felix.dependencymanager.shell;version='[3,4)',\
我也在看上面的书。在尝试 运行 项目时,我遇到了同样的问题。出现这个问题是因为我们手动给项目提供了dependency manager .jars
,这又和项目需要的.jar
版本冲突了
我使用 Amdatu Blueprint 在高级模式下进行了新的 Eclipse 设置,并且能够获得 运行ning 项目。 您可以在下面的 link 中获取安装详细信息:
http://amdatu-repo.s3.amazonaws.com/amdatu-blueprint/r1/docs/index.html#_install_eclipse