200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 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 us

时间:2022-10-14 18:56:10

相关推荐

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注解,问题轻松解决。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。