我一直在尝试关注“使用 OSGi 构建模块化云应用程序”。在“创建第一个 OSGi 应用程序”一书的第 3 章中,作者描述了如何使用 bndtools 在 eclipse 中创建一个带有服务的简单 OSGi 应用程序。
下面是我的类和配置的屏幕截图。
我面临的问题是
'!无法解析捆绑包:[agenda.service.simple-0.0.1捆绑包中未解决的约束议程.service.simple [9]:无法解决9.0:缺少要求[9.0] osgi.wiring.package;(&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))
] !无法启动捆绑议程.service.simple-0.0.1,异常捆绑议程.service.simple [9]中未解决的约束:无法解决9.0:缺少要求[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:找不到命令:b
G!lb gogo:CommandNotFoundException:找不到命令:llb
G!
G!
G!
G!
G!
G!
lb 起始级别 1 ID|状态|级别|名称
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)