【SpringBoot】More than one TaskExecutor bean found within the context
一、问题描述INFO [XNIO-1 task-1] o.s.s.a.AnnotationAsyncExecutionInterceptor:242 - More than one TaskExecutor bean found within the context, and none is named 'taskExecutor'. Mark one of them as primary or
·
一、问题描述
INFO [XNIO-1 task-1] o.s.s.a.AnnotationAsyncExecutionInterceptor:242 - More than one TaskExecutor bean found within the context, and none is named 'taskExecutor'. Mark one of them as primary or name it 'taskExecutor' (possibly as an alias) in order to use it for async processing: [taskScheduler, xxThreadPool, singleThreadPool]
二、问题解决
因为指定异步任务 @Async 时没有指定线程池,也没哟 @Primary 默认线程池,所以报错,代码加上 @Async("xxThreadPool") 问题解决
更多推荐
已为社区贡献5条内容
所有评论(0)