【问题标题】:Using blueprint as the Apache Camel DSL to describe routes in IBM Liberty使用蓝图作为 Apache Camel DSL 来描述 IBM Liberty 中的路由
【发布时间】:2015-05-02 11:17:10
【问题描述】:

我的目标是让 Camel 在使用 OSGi 的 IBM Liberty 应用服务器下运行,并能够在 Blueprint 中描述 DSL(域特定语言)路由。我正在取得进展,现在有一个安装了 Camel 并将其配置为 OSGi 包的 Liberty 环境。当我将 Java DSL Camel 应用程序编写为 OSGi 包时,一切都如我所愿。

我的最后一步是能够在蓝图中描述我的骆驼路线。为此,我创建了一个新的 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 Liberty 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))}, resource=org.apache.aries.subsystem.core.internal.SubsystemResource@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"

【问题讨论】:

    标签: apache-camel websphere-liberty blueprint-osgi


    【解决方案1】:

    如果解析器看不到捆绑包,或者捆绑包有问题(通常是蓝图),则可能会出现此消息。如果在您删除蓝图时捆绑包解析正常,那么您需要查看蓝图中可能有什么问题。如果是这种情况,我怀疑您没有在运行时启用 Camel 蓝图命名空间处理程序。

    我希望这会有所帮助。

    问候,格雷厄姆。

    【讨论】:

    • 鉴于错误消息看起来很笼统,是否有建议的跟踪设置或其他技术可以让我获得有关该消息的更多详细信息?我完全相信我可能没有正确设置环境,这可能意味着我需要 Camel 技术人员的帮助。我的 MANIFEST.MF 已在原始问题中复制,最新 Camel 的完整分发版已放置在 OSGi 内部存储库中……所以如果省略了某些内容……不确定它可能是什么。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-10
    • 2016-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多