Consistently accept "taskExecutor" bean of type Executor (as stated in @EnableAsync's javadoc)
Issue: SPR-15566
This commit is contained in:
@@ -219,6 +219,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
this.registrar.setTaskScheduler(resolveSchedulerBean(TaskScheduler.class, false));
|
||||
}
|
||||
catch (NoUniqueBeanDefinitionException ex) {
|
||||
logger.debug("Could not find unique TaskScheduler bean", ex);
|
||||
try {
|
||||
this.registrar.setTaskScheduler(resolveSchedulerBean(TaskScheduler.class, true));
|
||||
}
|
||||
@@ -239,6 +240,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
this.registrar.setScheduler(resolveSchedulerBean(ScheduledExecutorService.class, false));
|
||||
}
|
||||
catch (NoUniqueBeanDefinitionException ex2) {
|
||||
logger.debug("Could not find unique ScheduledExecutorService bean", ex2);
|
||||
try {
|
||||
this.registrar.setScheduler(resolveSchedulerBean(ScheduledExecutorService.class, true));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user