Dependency injection 无法部署包含通过Websphere 8.5中的aries blueprint定义的驼峰路由的osgi捆绑包

Dependency injection 无法部署包含通过Websphere 8.5中的aries blueprint定义的驼峰路由的osgi捆绑包,dependency-injection,websphere,apache-camel,blueprint,aries,Dependency Injection,Websphere,Apache Camel,Blueprint,Aries,我创建了一个.eba文件(enterprise bundle archive),其中包含一个具有apache驼峰路由(JavaDSL)的osgi包。骆驼上下文定义是通过蓝图xml文件完成的。当我尝试在Websphere Application Server 8.5中部署.eba文件时,出现以下异常: org.apache.aries.application.modeling.ModellerException:CWSAL0126E:建模捆绑包ib-base_0.0.1时发生异常。快照:org.a

我创建了一个.eba文件(enterprise bundle archive),其中包含一个具有apache驼峰路由(JavaDSL)的osgi包。骆驼上下文定义是通过蓝图xml文件完成的。当我尝试在Websphere Application Server 8.5中部署.eba文件时,出现以下异常:

org.apache.aries.application.modeling.ModellerException:CWSAL0126E:建模捆绑包ib-base_0.0.1时发生异常。快照:org.apache.aries.application.modeling.ModellerException:org.osgi.service.blueprint.container.ComponentDefinitionException:不支持的节点命名空间:

我的蓝图xml文件如下所示:

<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">

<camel:camelContext id="cbrContext" trace="false">
    <camel:packageScan>
        <camel:package>a.b.c.d</camel:package>
    </camel:packageScan>
</camel:camelContext>
</blueprint>

a、 不列颠哥伦比亚省
我不太清楚这在Websphere中失败的原因。在Karaf 3.0.0-SNAPSHOT中成功部署了相同的.eba文件。(此版本的Karaf使用Aries Blueprint 1.0.0版)

我猜WebSphere8.5中也使用了相同的版本,或者使用了Aries Blueprint 1.0.0的分叉版本

根据OSGi规范,自定义名称空间(如camel:)的任何blueprint扩展处理程序都是从OSGi服务注册表中的项(OSGi.Service.blueprint.namespace)下检索的。value元素告诉实际的名称空间uri

例如:


我不太清楚IBM为什么不遵守这个规范

另一个值得思考的有趣点是,当我尝试使用Websphere Application Developer工具创建blueprint.xml文件时,它只显示了4个扩展名,如下所示:

  • IBM蓝图扩展
  • JPA蓝图支持
  • 蓝图事务支持
  • 蓝图资源参考支持
  • 我确保骆驼核心包和骆驼蓝图包都部署在websphere的内部存储库中

    我尝试将.eba文件作为资源部署

    不太确定,如果我错过了什么。如果有人能给我指出正确的方向,我会很高兴

    致以最良好的祝愿


    Sriraman.

    WebSphere不支持自定义命名空间扩展(IBM提供的扩展除外)。主要原因是它在Aries(Blueprint容器)独立运行时上运行。有两种选择

    • 使用camel api而不是blueprint标记
    • 使用其他支持自定义命名空间扩展的容器(例如,Karaf)
    卡拉夫是骆驼的友好容器

    <service interface="org.apache.aries.blueprint.NamespaceHandler">
        <service-properties>
            <entry key="osgi.service.blueprint.namespace" value="http://camel.apache.org/schema/blueprint"/>
        <entry key="osgi.service.blueprint.namespace" value="http://camel.apache.org/schema/blueprint/cxf"/>
        </service-properties>
        <bean class="org.apache.camel.blueprint.handler.CamelNamespaceHandler">
        </bean>
    </service>