骆驼路线导致缺少依赖项错误
Camel route leads to Missing dependencies error
我目前正在尝试将骆驼路线部署到我的 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" 状态。我修复了所有缺失的依赖项(我认为它修复了),但我不理解此消息:
Bundle 251
---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies:
(&(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.
谢谢!
如果给schemaLocation
属性添加骆驼XSDurl会怎么样?
<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 的那部分。 Blueprint 需要知道 "where" 才能查找该命名空间的架构 (xmlns
= XML Name Space),然后搜索 schemaLocation
属性。
命名空间是标签的前缀,例如 <mythings:tag>
mythings 就是命名空间。通过使用 xmlns
属性,您基本上是在说 "everything in here has the following namespace"。
我发现问题出自:
Bundle 251 ---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))
这似乎与 Camel 2.16.3 有某种关系。一旦我升级到 2.18,一切都很好。 milo-client 端点依赖于 Camel 2.18。
谢谢大家的帮助!
我目前正在尝试将骆驼路线部署到我的 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" 状态。我修复了所有缺失的依赖项(我认为它修复了),但我不理解此消息:
Bundle 251 ---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies: (&(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.
谢谢!
如果给schemaLocation
属性添加骆驼XSDurl会怎么样?
<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 的那部分。 Blueprint 需要知道 "where" 才能查找该命名空间的架构 (xmlns
= XML Name Space),然后搜索 schemaLocation
属性。
命名空间是标签的前缀,例如 <mythings:tag>
mythings 就是命名空间。通过使用 xmlns
属性,您基本上是在说 "everything in here has the following namespace"。
我发现问题出自:
Bundle 251 ---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))
这似乎与 Camel 2.16.3 有某种关系。一旦我升级到 2.18,一切都很好。 milo-client 端点依赖于 Camel 2.18。
谢谢大家的帮助!