cancel
Showing results for 
Search instead for 
Did you mean: 

Spring service class not injected in Activiti listener?

vamsinipun
Star Contributor
Star Contributor

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 1

salaboy
Star Collaborator
Star Collaborator

How are you configuring/registering that listener into Activiti?