***************************
APPLICATION FAILED TO START
***************************
Description:
Field xxAuthenticationSuccessHandlerAppSocial in com.xx.xx.security.social.core.impl.AppSocialAuthenticationFilterPostProcessor required a single bean, but 2 were found:
- applicationTaskExecutor: defined by method 'applicationTaskExecutor' in class path resource [org/springframework/boot/autoconfigure/task/TaskExecutionAutoConfiguration.class]
- taskScheduler: defined by method 'taskScheduler' in class path resource [org/springframework/boot/autoconfigure/task/TaskSchedulingAutoConfiguration.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
参考:https://blog.csdn.net/Valhalla6416/article/details/89355490
解决方法:
在Application启动类中增加以下代码
@Primary
@Bean
public TaskExecutor primaryTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
return executor;
}