2015-03-02 83 views
0

我的目標是讓Camel使用OSGi在IBM Liberty應用服務器下運行,並且能夠描述Blueprint中的DSL(域特定語言)路由。我正在取得進展,現在已經安裝了一個Liberty環境,安裝了Camel並將其配置爲OSGi軟件包。當我將Java DSL Camel應用程序編寫爲OSGi包時,所有功能都完全按照我所希望的那樣工作。使用藍圖作爲Apache Camel DSL來描述IBM Liberty中的路由

我最後一步是能夠在藍圖中描述我的駱駝路線。爲此我創建一個新的OSGi包,並定義了blueprint.xml看起來如下:

<?xml version="1.0" encoding="UTF-8"?> 
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:camelBlueprint="http://camel.apache.org/schema/blueprint" 
    xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint-2.14.1.xsd"> 

    <camelBlueprint:camelContext> 
     <camelBlueprint:route> 
      <camelBlueprint:from uri="file:c:/temp/in"/> 
      <camelBlueprint:to uri="file:c:/temp/out"/> 
     </camelBlueprint:route> 
    </camelBlueprint:camelContext> 

</blueprint> 

當我嘗試部署此OSGi包,IBM的自由OSGi框架部署失敗與以下錯誤應用:

[3/2/15 0:42:38:796 CST] 00000035 com.ibm.ws.app.manager.esa.internal.DeploySubsystemAction 
A CWWKZ0403E: A management exception was generated when trying to install the application Camel1 into an OSGi framework. The error text from the OSGi framework is: 
Resource does not exist: org.apache.aries.subsystem.core.archive.SubsystemContentRequirement: 
namespace=osgi.identity, attributes={}, directives={filter=(&(osgi.identity=OSGITest1)(type=osgi.bundle)(version>=1.0.0))}, reso[email protected]7bc2d3bc 

不幸的是,這是我現在難倒和卡住的地方。我相信IBM Liberty使用Equinox作爲OSGi平臺,而不是Karaf,但是閱讀Camel Blueprint文檔,我似乎理解需要Apache Aries(Liberty提供和使用),並且Karaf不是依賴項。

我爲我的測試包MANIFEST.MF是:如果解析器不能看到包可以發生

Manifest-Version: 1.0 
Bundle-ManifestVersion: 2 
Bundle-Name: OSGITest1 
Bundle-SymbolicName: OSGITest1 
Bundle-Version: 1.0.0.qualifier 
Bundle-Blueprint: OSGI-INF/blueprint/*.xml 
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 
Export-Package: kolban.osgitest 
Import-Package: org.apache.camel;version="2.14.1", 
org.apache.camel.blueprint;version="2.14.1" 

回答

0

此消息,或者有一些錯誤的束(通常與藍圖)。如果在您移除藍圖時捆綁軟件解決問題,那麼您需要查看藍圖中可能存在的問題。如果是這種情況,我會懷疑你沒有在運行時啓用Camel blueprint命名空間處理程序。

我希望這會有所幫助。

問候,格雷厄姆。

+0

鑑於錯誤消息看起來很通用,有沒有建議的跟蹤設置或其他技術,我可以獲得有關消息的其他細節?我完全相信我可能沒有正確設置環境,這可能意味着我需要駱駝技術專家的幫助。我的MANIFEST.MF被複制到原始問題中,並且最新的Camel的完整發行被放置在OSGi內部存儲庫中...所以如果有東西被省略了......不知道它可能是什麼。 – Kolban 2015-03-02 16:21:32