
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or us
项目原来一直好好地,原来不怎么启动的模块,来了新任务,去启动了一下,发现报错 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在自动装配时冲突了,需把其中一个bean加上@Primary注解,或者每一个bean在注入时使用@Qualifier注解标识注入bean的名称。 再仔细翻一翻报错日志,找一找是哪些bean起了冲突 把日志中的bean,选一个加上@Primary注解,问题轻松解决。
👁️ 阅读量:0
© 版权声明:本文《Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or us》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686557248a291385.html。