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

你可能感兴趣的:(开发遇到的坑)