Hi @wwitt, I refer to your github project but I faced a problem when delegate task needs to @Autowired some service. May you please advise?
The setting of DemoConfiguration is same.
Error
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testDelegate’: Unsatisfied dependency expressed through field ‘TestService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.fifteenminuteflowable.demo.service.TestService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
***************************
APPLICATION FAILED TO START
***************************
Description:
Field testService in com.fifteenminuteflowable.demo.delegates.TestDelegate required a bean of type ‘com.fifteenminuteflowable.demo.service.TestService’ that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type ‘com.fifteenminuteflowable.demo.service.TestService’ in your configuration.
TestDelegate
package com.fifteenminuteflowable.demo.delegates;
@Component
public class TestDelegate implements JavaDelegate {
@Autowired
TestService testService;
@Override
public void execute(DelegateExecution delegateExecution) {
testService.call();
}
}