i have a problem. I have a Spring application, which i have deployed on jboss.
The Deployment on the server is ok. But i think, that all Beans defined in the applicationcontext throws a NPE.
Here my applicationContext ...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/camundabpm" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<context:annotation-config />
<bean id="eventService" class="com.kpmg.gbc.model.services.impl.EventServiceImpl"/>
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
<property name="processEngineName" value="engine" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="history" value="full"/>
</bean>
<bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<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" />
</beans>
I try to get the eventService in my ManagedJSF Bean and get a NPE.
I thought that I have misconfigured The eventService.
Therefore, I simply called the Bean RuntimeService of Camunda from the applicationcontext. The RuntimeService is null and throws a NPE.
Can you please tell me my Mistake
thanks.
Marcel
@ManagedBean(name="eventManagedBean")
@RequestScoped
public class EventManagedBean implements Serializable {
@Autowired
EventService eventService;
@Autowired
RuntimeService runtimeService;
......
public String storeEventAndStartProcess(){
try{
Event event = new Event();
//eventService.saveEvent(event);
runtimeService.startProcessInstanceById("AbrechnungVonStartschulungen");
return "success";
}
catch(Exception e){
e.printStackTrace();
}
return "error";
}
Hi Marcel,
Thanks for the replys.
public class CamundaCustomDelegate implements JavaDelegate {
@Autowired
private static RestTemplate restTemplate;
......
and application-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd ttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:annotation-config />
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate"/>
.......
Kind Regards
Gareth
Thanks Christian
<serviceTask camunda:class="com.company.bpm.camunda.delegate.CamundaDTDelegate" id="GUID-0A0200704FC6F17BC811AC8BCF4C4B6E" name="Data transformation task">
application-context.xml includes the bean definition:
<bean id="camundaEmailDelegate" class="com.company.bpm.camunda.delegate.CamundaEmailDelegate"/>
BPMN element now looks like:
<serviceTask camunda:expression="#{camundaEmailDelegate}" id="GUID-0A02001860E2FBEB13DF90928BF3B139" name="EMail task">
Is this happening in a unit test or in the real server?
Do you use the shared or embedded engine?
Please attach the complete stack trace, the processes.xml and the process application class.
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/710e1177-9682-40fc-b7e9-93ca99d906ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.