Description: The bean 'proxyRequestHelper', defined in class path resource [org/springframework/clo

本文解决SpringBoot与SpringCloud版本不一致导致的Zuul网关配置错误,详细介绍了错误原因及两种解决方案:一是修改Bean或类名并启用Bean定义覆盖;二是调整版本,确保SpringBoot与SpringCloud版本对应。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

配置zuul网关,启动springboot报错

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

情况一:方法名/bean和类名重复,这种情况一般不会出现,很少

情况二:springboot和springcloud版本不一致,多数是这种情况

解决办法:

一:修改bean或者类名,或者设置spring.main.allow-bean-definition-overriding=true

二:更换版本,保持springboot对应的springcloud版本,倒过来匹配也行

本人出现的情况是spring boot用的是2.1.1.RELEASE使用的springcloud版本是Finchley.RELEASE,实际springboot 2.1.1.RELEASE对应的springcloud版本应该是Greenwich.RELEASE

正确的对应版本依赖:

<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>Greenwich.RELEASE</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>2.1.1.RELEASE</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值