项目原来一直好好地,原来不怎么启动的模块,来了新任务,去启动了一下,发现报错
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注解,问题轻松解决。
更多推荐
Consider marking one of the beans as @Primary, updating the consumer to accept m
发布评论