简体   繁体   English

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)

I have been trying to follow 'Building Modular Cloud Apps with OSGi'. 我一直在尝试遵循“使用OSGi构建模块化云应用程序”。 In chapter 3 of the book 'Creating the first OSGi application' the author describes how to create a simple OSGi application with a service in eclipse with bndtools. 在“创建第一个OSGi应用程序”这本书的第3章中,作者描述了如何使用bndtools在eclipse中使用服务创建一个简单的OSGi应用程序。

Below is the screenshot of my classes and configurations. 下面是我的类和配置的屏幕截图。

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

The problem I am facing is 我面临的问题是

'! '! 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; 无法解析捆绑包:[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))) (&(osgi.wiring.package = org.apache.felix.dm)(版本> = 3.0.0)(!(版本> = 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; 无法启动捆绑包议程.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))) ____________________________' (&(osgi.wiring.package = org.apache.felix.dm)(版本> = 3.0.0)(!(版本> = 4.0.0)))____________________________'

Also, when i try to issue a command in the gogo shell that also doesnt input corretly sometimes. 另外,当我尝试在gogo shell中发出命令时,有时也不会正确输入。 But eventually when it does the bundle status looks like 但最终,捆绑包状态看起来像

g! G! lb gogo: CommandNotFoundException: Command not found: b lb gogo:CommandNotFoundException:找不到命令:b

g! G! lb gogo: CommandNotFoundException: Command not found: llb lb gogo:CommandNotFoundException:找不到命令:llb

g! G!

g! G!

g! G!

g! G!

g! G!

g! G!

lb START LEVEL 1 ID|State |Level|Name lb START LEVEL 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) 

Your agenda.service.simple bundle is looking for a bundle that exports a version of org.apache.felix.dm between 3.0.0 and 4.0.0, but it is only finding the 4.0.1 version that the Apache Felix Dependency Manager exports. 您的议程.service.simple捆绑包正在寻找一个捆绑包,该捆绑包可以导出3.0.0到4.0.0之间的org.apache.felix.dm版本,但是只能找到Apache Felix Dependency Manager导出的4.0.1版本。 。

Typically this would be caused by compiling against a different version of felix than you are running against. 通常,这可能是由于与您运行的felix版本不同而导致的。

Typically this would be caused by compiling against a different version of felix than you are running against. 通常,这可能是由于与您运行的felix版本不同而导致的。

True, this is likely to be caused by the fact that Bndtools selects the lowest version (in the specified version range) for buildpath dependencies and the highest version (in the specified version range) for runbundles. 的确,这很可能是由于Bndtools为构建路径依赖项选择了最低版本(在指定版本范围内),为runbundles选择了最高版本(在指定版本范围内)。

In your case no ranges are specified so version org.apache.felix.dependencymanager version 3.1.0 will be used for the buildpath and 4.0.1 for running your application. 在您的情况下,未指定范围,因此版本org.apache.felix.dependencymanager版本3.1.0将用于构建路径,版本4.0.1将用于运行应用程序。

To use version version 4 of the dependency manager you can change the buildpath entry to: 要使用版本4的依赖项管理器,可以将buildpath条目更改为:

org.apache.felix.dependencymanager;version='[4,5)'

Or to use version 3 at runtime you van change the -runbundles to 或者要在运行时使用版本3,可以将-runbundles更改为

org.apache.felix.dependencymanager;version='[3,4)',\
org.apache.felix.dependencymanager.shell;version='[3,4)',\

I am also reading the book above. 我也在看上面的书。 While trying to run the project, I had the same issue. 在尝试运行该项目时,我遇到了同样的问题。 This issue occurs because we manually provide dependency manager .jars to our project, which in turn conflicts with the version of .jar required for the project. 发生此问题的原因是,我们为项目手动提供了dependency manager .jars ,而后者又与项目所需的.jar版本冲突。

I did a new Eclipse setup in Advanced mode using Amdatu Blueprint and was able to get the running project. 我使用Amdatu Blueprint在“高级”模式下进行了新的Eclipse设置,并且能够获取正在运行的项目。 You can get the installation details in the link below: 您可以在下面的链接中获取安装详细信息:

http://amdatu-repo.s3.amazonaws.com/amdatu-blueprint/r1/docs/index.html#_install_eclipse http://amdatu-repo.s3.amazonaws.com/amdatu-blueprint/r1/docs/index.html#_install_eclipse

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 缺少要求osgi.wiring.package; (osgi.wiring.package = org.apache.xml.security.signature) - missing requirement osgi.wiring.package; (osgi.wiring.package=org.apache.xml.security.signature) OSGi:缺少要求osgi.wiring.package - OSGi: Missing requirement osgi.wiring.package 缺少要求osgi.wiring.package - Missing requirement osgi.wiring.package org.osgi.framework.BundleException:无法解决:缺少要求:osgi.wiring.package; (osgi.wiring.package = org.json) - org.osgi.framework.BundleException: Unable to resolve: missing requirement: osgi.wiring.package; (osgi.wiring.package=org.json) bundle中未解决的约束,缺少要求osgi.wiring.package - Unresolved constraint in bundle, missing requirement osgi.wiring.package maven bundle (felix) 错误:缺少需求 (osgi.wiring.package=io.searchbox.action) - maven bundle (felix) error: missing requirement (osgi.wiring.package=io.searchbox.action) 无法解决1.0:缺少需求[1.0] osgi.wiring.package; (&(osgi.wiring.package = - Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (&(osgi.wiring.package= 无法解决8.0:缺少要求[8.0] osgi.wiring.package; - Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; Karaf / Maven - 无法解决:缺少要求 osgi.wiring.package - Karaf / Maven - Unable to resolve: missing requirement osgi.wiring.package 缺少要求osgi.wiring.package = org.osgi.framework)(版本> = 1.8.0)(!(版本> = 2.0.0))) - missing requirement osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM