cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti taskListener method-Service reference null

rikin
Champ in-the-making
Champ in-the-making
Hi,

In Activiti User task Task Listener method i am trying to call service method which is autowired.But i m getting Serivice reference null.
Please Help.

testService is autowired.

   public void notify(DelegateTask delegateTask) {
      // TODO Auto-generated method stub
      testService.getData();
   }
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
How do you actually configure the task-listener? If you are using activiti:class="org.my.company.Listener", the injection won't work as the instance of the "Listener" is created by activiti, without any knowledge of spring-context.

If you want to use a spring-bean as listener, you should use this approach: activiti:delegateExpression="${listenerBeanName}".