SpringBoot项目启动报错:Consider renaming one of the beans or enabling overriding by setting
·
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
SpringBoot项目启动报错:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
-
报错信息如下:
-
错误原因:在项目中定义了多个bean,加载时造成了bean的冲突,需要给每个bean加上标识,或者在.yml配置文件中定义配置信息
解决方案1.加上标识
解决方案2:配置文件定义:
spring.main.allow-bean-definition-overriding=true
更多推荐
已为社区贡献1条内容
所有评论(0)