【发布时间】:2020-07-07 12:58:54
【问题描述】:
我正在使用 Spring Boot 并尝试使用 Spring 集成(因为我想使用它的 SFTP 客户端)。但我收到以下错误:
Description:
Parameter 0 of constructor in com.example.demo.service.ServiceOne 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 in null
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
我确定在为 spring-integration 添加依赖项后会发生错误。我尝试使用@Qualifier("applicationTaskExecutor") 并创建一个带有@Primary 注释的bean,但仍然无法运行该应用程序。如何解决?
【问题讨论】:
标签: spring-boot spring-integration