Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans

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

***************************
APPLICATION FAILED TO START
***************************

Description:
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

考虑将其中一个bean标记为@Primary,更新使用者以接受多个bean,或者使用@Qualifier标识应该使用的bean

出现这个错误主要是你的spring里面的bean名字重复了。
在注解后可以加不同的名字区分bean。

 @Bean(name = "name")
 @Bean(name = "beanName")
 @Component("defaultName")
 @Service("primarilyName")

仔细排查在错误日志可以得到具体的错误位置,直接定位到错误。

展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 书香水墨 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读