2016-11-23 63 views
0

目前,我嘗試部署般地路線我karaf容器(在Spring DSL):駱駝路線導致缺少依賴錯誤

<?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" 
    xsi:schemaLocation=" 
     http://www.osgi.org/xmlns/blueprint/v1.0.0 
     http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> 
    <bean id="milo-client" class="org.apache.camel.component.milo.client.MiloClientComponent"> 
     <!--<property name="enableAnonymousAuthentication" value="true"/>--> 
    </bean> 
    <camelContext xmlns="http://camel.apache.org/schema/blueprint"> 
     <route id="opctorest"> 
     <from uri="timer://simpleTimer?period=1000"/> 
     <log message="Triggered Route: opctorest: Sensorreading body: ${body}"/> 
     <to uri="milo-client:tcp://127.0.0.1:4840/freeopcua/server?namespaceUri=http://examples.freeopcua.github.io"/> 
     <convertBodyTo type="java.lang.String"/>   
     <to uri="stream:out"/> 
     </route> 
    </camelContext> 
</blueprint> 

該路由的包沒有安裝,但仍保留在「GRACEPERIOD 「 狀態。我修復了所有缺少的依賴關係(我認爲這沒有),但我不明白這條消息:

包251 ----------狀態:GRACEPERIOD藍圖16年11月23日2: 08時缺少的依賴關係: (&(objectClass的= org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace = http://camel.apache.org/schema/blueprint))

我能做些什麼來解決這種依賴?和白羊座一樣安裝了camel-blueprint。 Karaf是4.0.5版本。藍圖是2.16.3。

謝謝!

+0

是'駱駝藍圖'激活你的卡拉夫容器? – usha

+0

是:47 |活動| 50 | 2.16.3 | camel-blueprint – Fluffy

+0

您是否安裝了camel-stream功能:安裝? –

回答

0

這似乎是主題相關的駱駝2.16.3。只要我升級到2.18,一切都很好。 milo-client端點取決於Camel 2.18。

謝謝大家的幫助!

0

如果您將駱駝XSD url添加到schemaLocation屬性會怎麼樣?

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xmlns:camel="http://camel.apache.org/schema/blueprint" 
      xsi:schemaLocation=" 
       http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"> 

編輯:我是在評論,但是這是一個很長的故事,所以在這兒呢。

我不是100%確定的,但<camelContext xmlns="http://camel.apache.org/schema/blueprint">告訴Blueprint使用哪個命名空間來驗證XML的那部分。藍圖需要知道「在哪裏」查找該名稱空間的模式(xmlns = XMLN ame S步調),並搜索schemaLocation屬性。
命名空間是標籤的前綴,例如<mythings:tag>mythings是命名空間。通過使用xmlns屬性,你基本上說「這裏的所有東西都有以下命名空間」。

我意識到這是從問題:

包251 ----------狀態:GRACEPERIOD藍圖16年11月23日日下午2:08缺少的依賴關係:(&(對象類= org.apache.aries.blueprint。NamespaceHandler)(osgi.service.blueprint.namespace = http://camel.apache.org/schema/blueprint))

+0

哇,謝謝。這有幫助。但爲什麼?:) – Fluffy

+0

@fluffy增加了一種解釋:-) –

+0

這很奇怪,sinse我採取NS申報表工作教程等似乎工作。無論如何,謝謝你的幫助和解釋:) – Fluffy