✅ 操作成功!

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

发布时间:2023-06-12 作者:admin 来源:文学

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

项目原来一直好好地,原来不怎么启动的模块,来了新任务,去启动了一下,发现报错 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