admin管理员组

文章数量:1567031

场景

SpringBoot项目在启动时提示:

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

因为sringboot通过@Autowired注入接口的实现类时发现有多个,也就是有多个类继承了这个接口,spring容器不知道使用哪一个。

加@Primary表示某个实现类首选注入

本文标签: 提示beansmarkingSpringBootPrimary