2013-03-02 115 views
1

我嘗試啓動由Maven在FUSE ESB OSGi容器中創建的包。但我得到它的三個依賴關係的錯誤:OSGi使用約束衝突

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] 

任何人都可以向我解釋這個錯誤是什麼?

+0

閱讀我的博客文章,瞭解OSGi中的「使用約束」的解釋:http://njbartlett.name/2011/02/09/uses-constraints.html – 2013-03-02 22:42:59

+0

感謝您的尼爾發佈。現在我找出問題是'apache.http',就像你的例子中所示'ulti.verify'。在您的文章中,您通過刪除重複來提供解決方案。但我想知道如何刪除它。通過更改清單中的導出? – 2013-03-03 23:49:42

回答

2

你是如何安裝http核心和客戶端軟件包的?

您可以嘗試安裝camel-http4作爲功能,因爲它提供了開箱即用的http客戶端。

features:install camel-http4 

然後再安裝自己的包。