启动zuul时:The bean 'proxyRequestHelper', defined in class path resource

报错信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulProxyAutoConfiguration$NoActuatorConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulProxyAutoConfiguration$EndpointConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Process finished with exit code 1

原因是SpringCloud与SpringBoot版本不一致。
SpringBoot版本为2.1.1.RELEASE;SpringCloud版本为Finchley.RELEASE
后将SpringCloud版本改为Greenwich.RC2后,成功启动。配置如下:

 <properties>
        <java.version>1.8</java.version>
        <!-- <spring-cloud.version>Finchley.RELEASE</spring-cloud.version>-->
        <spring-cloud.version>Greenwich.RC2</spring-cloud.version>
    </properties>


 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
        <relativePath/>
    </parent>

猜你喜欢

转载自blog.csdn.net/LFfootprint/article/details/86440775