Я использую 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-интеграции. Я попытался использовать @Qualifier("applicationTaskExecutor")
и создать компонент с аннотацией @Primary
, но все еще не смог запустить приложение. Как это исправить?