2016-11-23 62 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