springcloud整合nacos启动时报错The bean ‘nacosRefreshProperties‘, defined in class path resource

异常信息

Description:

The bean 'nacosRefreshProperties', defined in class path resource [com/alibaba/cloud/nacos/NacosConfigAutoConfiguration.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/C:/Users/acer/.m2/repository/com/alibaba/cloud/spring-cloud-starter-alibaba-nacos-config/2.2.3.RELEASE/spring-cloud-starter-alibaba-nacos-config-2.2.3.RELEASE.jar!/com/alibaba/cloud/nacos/refresh/NacosRefreshProperties.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

解决方法

spring:
  # 后面的bean会覆盖前面相同名称的bean
  main:
    allow-bean-definition-overriding: true

Guess you like

Origin blog.csdn.net/m0_46267375/article/details/121570785