使用自动注入集合类时候提示
Description:
Field xxx in com.XXX.xxx required a single bean, but 3 were found:
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
解决
- 参考docs.spring.io
- 在其中一个个
bean
上添加@Primary