本文主要是介绍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
这篇关于SpringBoot项目启动报错:Consider renaming one of the beans or enabling overriding by setting的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!