SpringBoot项目启动报错:Consider renaming one of the beans or enabling overriding by setting

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

  1. 报错信息如下:

  2. 错误原因:在项目中定义了多个bean,加载时造成了bean的冲突,需要给每个bean加上标识,或者在.yml配置文件中定义配置信息

    解决方案1.加上标识

    解决方案2:配置文件定义:

    spring.main.allow-bean-definition-overriding=true
    
转载请说明出处内容投诉
CSS教程_站长资源网 » SpringBoot项目启动报错:Consider renaming one of the beans or enabling overriding by setting

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买