【发布时间】: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