启动springboot项目,控制台报如下错误:
Description:
The bean 'xxx-xxx.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
image.png
解决办法:
此错误是因为spring容器中存在相同名称的bean对象,在yml配置文件中配置代码
main:
allow-bean-definition-overriding: true
覆盖相同名称的bean即可:
spring:
application:
name: xxx-xxx-service
main:
allow-bean-definition-overriding: true # 后来发现的bean会覆盖之前相同名称的bean
网友评论