Package uses conflict: Import-Package: de.foo.bar; version=“0.0.0”

ⅰ亾dé卋堺 提交于 2019-12-11 06:05:32

问题


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"

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"

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).

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?

Thanks for any help

Klaus


System Information:

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

回答1:


I finally found what was wrong.

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.

EDIT:

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.

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



来源:https://stackoverflow.com/questions/3466379/package-uses-conflict-import-package-de-foo-bar-version-0-0-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!