Hello,
I am currently working on a project using the fuse service works (switchyard, ....). I have created a Spring XML configuration file (src/main/resources/META-INF/beansCDI.xml) which contains the CDI beans (beans, camelContext, ...) that i want to inject. The issue that I cannot retrieve the beans defined in beansCDI.xml to inject them in my camel route (route.xml). Also, I have tried to use ApplicationContext to load beansCDI.xml but without success. Note that using annotations (@Produces @Named) to inject beans works perfectly. But, in my case i want to use the spring DSL.
Here my beansCDI.xml [example taken from the "Camel in Action" book]:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost" />
</bean>
</property>
</bean>
<bean id="ftpToJmsRoute" class="camelinaction.FtpToJMSRoute" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<routeBuilder ref="ftpToJmsRoute" />
</camelContext>
</beans>
Any suggestions would be grateful.
Thank you.
To whom it may concern, this issue have been discussed and solved in this thread: https://developer.jboss.org/thread/199293.