0


SpringBoot中提示required a single bean, but 2 were found

两种解决办法:
一.
1.把其一个bean加上@Primary注解

2.在注入的属性添加@Qualifier注解

二.

Springboot启动类添加了的扫描注解@xxxSan,需要配置好扫描范围,否则就会出现重复扫描。

标签: spring boot java spring

本文转载自: https://blog.csdn.net/m0_74883163/article/details/135336115
版权归原作者 一只程序猿& 所有, 如有侵权,请联系我们删除。

“SpringBoot中提示required a single bean, but 2 were found”的评论:

还没有评论