两种解决办法: 一. 1.把其一个bean加上@Primary注解 2.在注入的属性添加@Qualifier注解 二. Springboot启动类添加了的扫描注解@xxxSan,需要配置好扫描范围,否则就会出现重复扫描。