2015-04-15 3 views
1

Я устанавливаю тело маршрута верблюда с помощью Bean. Это работает на автономном проекте Camel. Когда он установлен на JBoss Fuse, компонент Spring не найден. Вот отрывок из плана:Невозможно найти Весеннюю фасоль в проекте предохранителей

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

При развертывании на предохранитель, следующее исключение сгенерировано:

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' 

Любая помощь?

ответ

1

У меня была такая же проблема недавно. К сожалению, не удалось разрешить это с помощью spel и переключилось на простое. Это должно помочь в вашем случае:

<simple>${bean:personFactory?method=createPerson(property.name, property.surname)}</simple>