The bean ‘xxx‘, defined in class path resource [xxx], could not be registered.A bean with that name

Spring在配置Bean的时候,可能会出现这样的错误!!!
原因是 因为相同名字的bean已经存在了。
若是找不到在哪里出现的,可以直接选择在配置文件application.properties里面进行覆盖

spring.main.allow-bean-definition-overriding=true

版权声明:本文为qq_39728274原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。