Spring service class not injected in Activiti listener?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Established Member

Spring service class not injected in Activiti listener?

Hi,

I am using activiti in spring web application. Now, i am facing an issue. if i inject spring service class in activiti listener then it showing an error at runtime.

My java listener code is

@Component
public class MyEventListener implements TaskListener {

@Autowired
ILocalConveyanceService localConveyanceService;

@Override
public void notify(DelegateTask delegateTask) {
    System.out.println("Task listener called");
    System.out.println("delegateTask: "+delegateTask.getProcessInstanceId());
    List<TblLocalConveyance> all = localConveyanceService.getAll();
    for (TblLocalConveyance tblLocalConveyance : all) {
                   System.out.println("LCNo: "+tblLocalConveyance.getLcNo());
    }

  }

}

Please help me out this.

1 Reply
Highlighted
Senior Member

Re: Spring service class not injected in Activiti listener?

How are you configuring/registering that listener into Activiti?