Reputation: 2485
I'm setting the body of a Camel route using a Bean. That works on a Camel standalone project. When deployed on JBoss Fuse the Spring bean is not found. Here is a snippet of the blueprint:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
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/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean id="personFactory" class="sample.PersonFactory" />
<bean id="myBean" class="sample.Person" />
<camelContext id="cbr-example-context" xmlns="http://camel.apache.org/schema/blueprint" xmlns:order="http://fusesource.com/examples/order/v7">
<route id="myroute">
<from uri="timer:foo?repeatCount=1"/>
<setProperty propertyName="name">
<constant>John</constant>
</setProperty>
<setProperty propertyName="surname">
<constant>Doe</constant>
</setProperty>
<setBody>
<spel>#{@personFactory.createPerson(properties['name'],properties['surname'])}
</spel>
</setBody>
. . . .
</route>
</camelContext>
</blueprint>
When deployed on Fuse, the following exception is raised:
org.apache.camel.ExpressionEvaluationException: org.springframework.expression.spel.SpelEvaluationException:
EL1057E:(pos 1): No bean resolver registered in the context to resolve access to bean 'personFactory'
Any help ?
Upvotes: 1
Views: 177
Reputation: 830
I had same problem recently. Unfortunately, did not managed to resolve this using spel and have switched to simple. This should help in your case:
<simple>${bean:personFactory?method=createPerson(property.name, property.surname)}</simple>
Upvotes: 1