启动报错,错误信息如下:
Description:
Parameter 0 of method quartzEndpoint in org.springframework.boot.actuate.autoconfigure.quartz.QuartzEndpointAutoConfiguration required a single bean, but 2 were found:
- SchedulerFactory: defined by method 'schedulerFactoryBean' in class path resource [com/biaoqian/provider/config/SchedulerConfig.class]
- Scheduler: defined by method 'scheduler' in class path resource [com/biaoqian/provider/config/SchedulerConfig.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
网上找的解决方案是 在 SchedulerConfig 配置类中的 scheduler() 方法上加上注解@Primary,项目正常启动(具体原因还不清楚,以后发现了再补充)
参考连接: