我们正在使用Blueprint + Camel + Karaf,从Spring迁移。 我是新的OSgi蓝图。我们使用Blueprint XML来定义blueprint xml中定义的bean的服务。骆驼路线无法找到在其他蓝图xml文件(其他捆绑)中定义的bean
后,我们在蓝图XML增值业务,至少从karaf得到如下: FYI:束处于Active状态
karaf>service:list | grep custom
[org.apache.camel.Processor, com.rnd.model.impl.PaymentServiceProcessorBase,com.rnd.generic.CustomServiceP rocessor]osgi.service.blueprint.compname = customPaymentProcessor
我相信bean被注册到OSGi服务。但不知何故,其他Bundle中的其他XML不可见。
**Blueprint XML**::
<bean id="customPaymentProcessor" class="blah blah"/>
<service ref="customPaymentProcessor" auto-export="all-classes"/>
请帮我如何获得accesss(下karaf根目录)文件夹这个bean在路由XML文件中的AppConfig。
myRoutes.xml
<!-- Add this route to CamelContext Using LoadRouteDefinitions -->
<routes id="xyz-Context" xmlns="http://camel.apache.org/schema/spring">
<route id="xyz-one">
<from uri="direct:xyz"/>
<!-- this customPayProcesssor is exposed as above -->
<process ref="customPayProcesssor"/>
</route>
</routes>
所有OSGi服务都隐含注册为OSGi regsitry骆驼进行搜索。但我得到; ::
[Bean[ref:cust... because of No bean could be found in the registry for: customPaymentProcessor
在我尝试你的之前,我已经阅读过我上面提到的redhat论坛。在我的routes.xml中,我如何使用这是无效的? –
Slok
如果您确实使用蓝图(而不是Spring),则参考元素应该可用。也许你错过了一个命名空间? – noMad17