【问题标题】:Camel route leads to Missing dependencies error骆驼路线导致缺少依赖项错误
【发布时间】:2016-11-23 13:46:26
【问题描述】:

我目前正在尝试将骆驼路线部署到我的 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 Blueprint 11/23/16 2:08 PM 缺少依赖项: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))

我可以做些什么来解决这种依赖关系? camel-blueprint 和 aries 一样已安装。 Karaf 是 4.0.5 版。蓝图是 2.16.3。

谢谢!

【问题讨论】:

  • camel-blueprint 是否激活了您的 karaf 容器?
  • 是:47 |活跃 | 50 | 2.16.3 |骆驼蓝图
  • 您是否安装了带有 features:install 的骆驼流功能?
  • 您是如何安装的?通常最好做功能:安装任何与骆驼相关的东西。
  • camel-stream 已安装,所有功能都通过功能安装安装。唯一的事情是其中一个端点:milo-client 是通过 .kar 文件安装的。但这似乎不是问题还是我在这里被误导了?

标签: apache-camel apache-karaf


【解决方案1】:

如果给schemaLocation属性添加camel XSD url呢?

<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% 确定,但&lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt; 告诉 Blueprint 使用哪个命名空间来验证 XML 的那部分。 Blueprint 需要知道“在哪里”查找该命名空间的架构 (xmlns = XML Name Space),然后搜索 @987654326 @ 属性。
命名空间是标签的前缀,例如&lt;mythings:tag&gt; mythings 是命名空间。通过使用xmlns 属性,您基本上是在说“这里的所有东西都有以下命名空间”。

我意识到这是来自:

Bundle 251 ---------- 状态:GracePeriod Blueprint 11/23/16 2:08 PM 缺少依赖项:(&(objectClass=org.apache.aries.blueprint.NamespaceHandler强>)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))

【讨论】:

  • @fluffy 添加了一种解释 :-)
  • 这很奇怪,因为我采用了 NS 声明表工作教程等,这似乎有效。无论如何,谢谢你的帮助和解释:)
  • 嗯,我又卡在那里了。重新启动karaf后,似乎没问题。但现在错误又回来了,我无法摆脱“宽限期”,我的捆绑包卡在那里:\
  • 你运行的是哪个版本的 Karaf?
  • 我正在运行 karaf 4.0.5
【解决方案2】:

它似乎与 Camel 2.16.3 有关。一旦我升级到 2.18,一切都很好。 milo-client 端点依赖于 Camel 2.18。

感谢大家的帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-01
    • 2019-04-09
    • 2014-12-11
    • 1970-01-01
    相关资源
    最近更新 更多