【问题标题】:OSGi uses constraint violationOSGi 使用约束冲突
【发布时间】:2013-02-16 16:48:10
【问题描述】:

我尝试在 FUSE ESB OSGi 容器中启动由 Maven 创建的包。但我的三个依赖项出错了:

1. libthrift-0.7.0.jar
2. httpclient-4.0.1.jar
3. httpcore-4.0.1.jar

Error executing command: Error starting bundles:
Unable to start bundle 262: Uses constraint violation. Unable to resolve bundle 
revision file__opt_FuseESBEnterprise-7.1.0_deploy_libthrift-0.7.0.jar [316.0]
because it is exposed to package 'org.apache.http' from bundle revisions 
org.apache.httpcomponents.httpcore [291.0] and org.apache.httpcomponents.httpclient     
[290.0] via two dependency chains.

Chain 1:
 file__opt_FuseESBEnterprise-7.1.0_deploy_libthrift-0.7.0.jar [316.0]
import: (osgi.wiring.package=org.apache.http)
 |
export: osgi.wiring.package=org.apache.http
org.apache.httpcomponents.httpcore [291.0]

Chain 2:
file__opt_FuseESBEnterprise-7.1.0_deploy_libthrift-0.7.0.jar [316.0]
import: (osgi.wiring.package=org.apache.http.client)
 |
export: osgi.wiring.package=org.apache.http.client; uses:=org.apache.http
export: osgi.wiring.package=org.apache.http
org.apache.httpcomponents.httpclient [290.0]

谁能解释一下这个错误是关于什么的?

【问题讨论】:

  • 阅读我的博文,了解 OSGi 中“使用约束”的解释:njbartlett.name/2011/02/09/uses-constraints.html
  • 感谢尼尔的帖子。现在我发现问题是apache.http,就像您的示例中所示的ulti.verify。在您的帖子中,您通过删除重复来提供解决方案。但我想知道如何删除它。通过更改清单中的导出?

标签: maven osgi bundle fuseesb jbossfuse


【解决方案1】:

您是如何安装 http 核心和客户端捆绑包的?

您可以尝试将 camel-http4 安装为一项功能,因为它提供了开箱即用的 http 客户端。

features:install camel-http4

然后安装你自己的包。

【讨论】:

    猜你喜欢
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 2016-02-27
    • 2011-03-05
    • 1970-01-01
    • 2018-03-29
    • 2021-08-04
    • 2014-08-16
    相关资源
    最近更新 更多