Hello,
I have a problem when use ${camel.sendTo(‘direct:asyncService’)} in my BPM flow. When testing the system, I found out the service task gets a Error while evaluating expression: ${camel.sendTo(‘direct:asyncService’)}. Cause: Could not lookup beanmanager in jndi.
I am working with spring in my context I define this:
<!-- bind the process engine service as Spring Bean -->
<bean name="processEngineService" class="org.camunda.bpm.BpmPlatform"
factory-method="getProcessEngineService" />
<!-- bind the default process engine as Spring Bean -->
<bean name="processEngine" factory-bean="processEngineService"
factory-method="getDefaultProcessEngine" />
<bean id="repositoryService" factory-bean="processEngine"
factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine"
factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine"
factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine"
factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine"
factory-method="getManagementService" />
<bean id="camel" class="org.camunda.bpm.camel.spring.CamelServiceImpl">
<property name="processEngine" ref="processEngine" />
<property name="camelContext" ref="camelContext" />
</bean>
<bean id="camel" class="org.camunda.bpm.camel.spring.CamelServiceImpl">
<property name="processEngine" ref="processEngine" />
<property name="camelContext" ref="camelContext" />
</bean>
My bpmn file has the following:
<bpmn:serviceTask id="Task_187w3iw" name="Send" camunda:expression="${camel.sendTo('direct:asyncService')}">
<bpmn:incoming>SequenceFlow_1m7wu3i</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0sw3wk8</bpmn:outgoing>
</bpmn:serviceTask>
My CamelBootStrap has the following:
public class CamelBootStrap {
private final static Logger log = Logger.getLogger(
CamelBootStrap.class.getCanonicalName());
@Inject
private CamelContext camelContext;
@Inject
private ProcessEngine processEngine;
@Inject
private MessageRouteImpl messageRoute;
@PostConstruct
public void init() throws Exception {
log.info("=======================");
log.info("Initializing Camel");
CamundaBpmComponent component = new CamundaBpmComponent(processEngine);
component.setCamelContext(camelContext);
camelContext.addComponent("camunda-bpm", component);
camelContext.addRoutes(messageRoute);
camelContext.start();
log.info("Successfully started Camel with components: " + camelContext.getComponentNames());
log.info("=======================");
}
@PreDestroy
public void shutDown() throws Exception {
log.info("=======================");
log.info("Shutting down Camel");
camelContext.stop();
log.info("=======================");
}
}