包使用冲突:Import-Package:de.foo.bar;版本=“0.0.0”

发布于 2024-09-14 04:45:55 字数 905 浏览 3 评论 0原文

我尝试在 OSGi 环境 (FUSE ESB) 中安装捆绑包,但未能解决该问题。错误消息是:

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”指令来完成此操作。

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

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

我检查了这一点,还尝试了几个版本更改(0.0.0 和真实版本号),但无法让它工作。

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

感谢您提供任何帮助

Klaus


系统信息:

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:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寻找我们的幸福 2024-09-21 04:45:55

我终于发现出了什么问题。

我的包是一个 Spring 动态模块包,我在 spring bean 配置中犯了一个错误(在构造函数参数中使用“ref”而不是“值”)。通常 spring 配置错误会这样报告 - 我不知道为什么当前错误会导致误导性消息。

编辑:

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

试图解决我的问题我发现文章 诊断 OSGi 使用冲突 我发现这有助于理解问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文