本文介绍了程序包使用冲突:导入程序包:de.foo.bar;版本="0.0.0&"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在OSGi环境(FUSE ESB)中安装捆绑软件,但是无法解决它.错误消息是:

I try to install a bundle in an OSGi environment (FUSE ESB) but do not manage to get it resolved. The error message is:

The bundle could not be resolved. Reason: Package uses conflict: Import-Package: de.foo.bar; version="0.0.0"

我的捆绑软件导入了包 de.foo.bar .导出软件包 de.foo.bar 的捆绑包使用'uses'指令执行此操作.

My bundle imports the package de.foo.bar.The bundle which exports the package de.foo.bar does this with a 'uses' directive.

Export-Package = de.foo.bar;uses:="{other packages}";version="2.4.0"

据我了解,我必须确保捆绑软件必须导入de.foo.bar软件包的"uses"指令(在正确的版本中)中提到的所有其他软件包.

As I understood I have to ensure that my bundle must import all other packages mentioned in the 'uses' directive of the de.foo.bar package (in the right version).

我检查了这一点,还尝试了几次版本更改(0.0.0和真实版本号),但无法使其正常工作.

I checked this and also tried several version changes (0.0.0 and the real version numbers) but can not get it to work.

那么,错误消息的真正含义是什么(也许我理解错了)?我要检查什么?

So, what does the error message realy means (maybe I understood it wrong)? What do I have to check?

感谢您的帮助

克劳斯

系统信息:

  • FUSE ESB 4.2.0 (based on servicemix)
  • using maven-bundle-plugin 2.1.0 to generate OSGi MANIFEST header

推荐答案

我终于找到了问题所在.

I finally found what was wrong.

我的包是Spring Dynamic Module包,我在spring bean配置中犯了一个错误(在构造函数arg中使用"ref"而不是"value").通常,弹簧配置错误是这样报告的-我不知道为什么当前错误导致了误导性消息.

My bundle is a Spring Dynamic Module bundle and I did a mistake in the spring bean configuration (use a 'ref' instead a 'value' in a constructor-arg). Normally spring configuration errors are reported as such - I do not know why the current error resulted in the misleading message.

错误的Spring配置不会导致使用冲突.最终是导入了 org.apache.log4j 软件包,该软件包由不同的捆绑软件导出(在我的FUSE ESB容器中),并且显然与我尝试安装的捆绑软件不同.

The faulty Spring configuration does not cause the uses conflict. It finally was the import of the package org.apache.log4j which is exported by different bundles (in my FUSE ESB container) and apparently was different wired to the bundles I tried to install.

试图解决我的问题,我发现了文章诊断OSGi使用了冲突,我发现它对理解问题很有帮助.

Trying to solve my problem I found the article Diagnosing OSGi uses conflicts which I found helpfull to understand the problem.

这篇关于程序包使用冲突:导入程序包:de.foo.bar;版本="0.0.0&"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 22:45