无法部署包含通过白羊座蓝图的Websphere 8.5所定义的骆驼路线的OSGi包 [英] Unable to deploy a osgi bundle containing a camel route defined via aries blueprint in Websphere 8.5

查看:347
本文介绍了无法部署包含通过白羊座蓝图的Websphere 8.5所定义的骆驼路线的OSGi包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个包含有一个Apache的骆驼航线(Java的DSL)一个OSGi包一个.eba文件(企业捆绑归档)。骆驼上下文定义是通过蓝图XML文件完成的。当我试图部署在WebSphere Application Server 8.5 .eba文件,我得到了以下异常:

I created an .eba file (enterprise bundle archive) that contains one osgi bundle having a apache camel route (Java DSL). The camel context definition is done via a blueprint xml file. When I tried to deploy the .eba file in Websphere Application Server 8.5, I got the following exception:

org.apache.aries.application.modelling.ModellerException:CWSAL0126E:发生异常而造型束IB-base_0.0.1.SNAPSHOT:org.apache.aries.application.modelling.ModellerException:org.osgi.service.blueprint .container.ComponentDefinitionException:不支持节点命名空间: http://camel.apache.org/schema/blueprint

org.apache.aries.application.modelling.ModellerException: CWSAL0126E: An exception occurred while modelling bundle ib-base_0.0.1.SNAPSHOT: org.apache.aries.application.modelling.ModellerException: org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace: http://camel.apache.org/schema/blueprint.

我的蓝图XML文件如下:

My blueprint xml file is as follows:

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

我也不太清楚为什么这种失败在WebSphere中。同样.eba文件被成功部署在Karaf 3.0.0快照。 (这Karaf的版本使用白羊座蓝图1.0.0版本)。

I am not too sure why this fails in Websphere. The same .eba file gets successfully deployed in Karaf 3.0.0-SNAPSHOT. (This version of Karaf uses Aries Blueprint version 1.0.0).

我猜想的一样或者因白羊座蓝图1.0.0分支版本是WebSphere 8.5。

I guess the same is used or a forked version of the Aries Blueprint 1.0.0 is used in Websphere 8.5.

按OSGi的规格,对于像骆驼自定义命名空间的蓝图扩展处理程序:从OSGi服务注册表键(osgi.service.blueprint.namespace)根据检索。值元素告诉实际的命名空间URI。

As per the OSGi specs, any blueprint extension handlers for custom namespaces like camel: are retrieved from the OSGi Service Registry under the key (osgi.service.blueprint.namespace). The value element tells the actual namespace uri .

例如:

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

我也不太清楚为什么IBM不遵守此规范。

I am not too sure why IBM does not honor this spec.

另一个有趣的点思考的是,当我试图创建一个使用WebSphere应用程序开发工具的蓝图.xml文件,仅显示4扩展了事实上正如下图所示:

Another interesting point to ponder over is the fact that when I tried to create a blueprint .xml file using Websphere Application Developer Tool, it shows only 4 extensions as shown below:


  1. IBM蓝图扩展

  2. JPA蓝图支持

  3. 蓝图事务支持

  4. 蓝图资源引用的支持

我保证,无论是骆驼核心和骆驼蓝图捆绑在WebSphere中的内部存储库进行部署。

I ensured that both the camel-core and camel-blueprint bundles are deployed in the internal repository in websphere.

我试图部署.eba文件作为资产。

I tried to deploy the .eba file as an asset.

也不太清楚,如果我错过了一些东西。我会很高兴,如果有人能在正确的方向指向我。

Not too sure, if I have missed something. I would be glad if someone can point me in the right direction.

最好的问候,

Sriraman。

推荐答案

的WebSphere不支持自定义命名空间扩展(不是由IBM提供的另外一个)。最主要的原因是它在白羊座(Blueprint容器)分离运行时运行。有两个选项

WebSphere does not support custom namespace extension (other than the one provided by IBM). The main reason being it runs on Aries (Blueprint container) isolated runtime. There are two options


  • 使用骆驼的API,而不是蓝图标记

  • 使用其他容器(例如Karaf),它支持自定义空间扩展

Karaf是骆驼友好的容器中。

Karaf is a friendly container for camel.

这篇关于无法部署包含通过白羊座蓝图的Websphere 8.5所定义的骆驼路线的OSGi包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆