使用Gateway出现Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.

在集成Spring Cloud Gateway时遇到错误提示'Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.'。通过分析依赖树发现,错误源自spring-boot-starter-web依赖于spring-cloud-starter-netflix-hystrix-dashboard。移除该项目中对该依赖的引用,问题得到解决,应用成功启动。" 131937411,11667037,Nacos心跳配置优化:快速服务上下线,"['Java', '后端开发', '微服务', 'Spring Cloud Alibaba', 'Nacos']
摘要由CSDN通过智能技术生成

在使用Gateway时碰到了一些问题
在这里插入图片描述
子项目pom依赖中并没有spring-boot-starter-web的配置,它提示让我移除,我猜想是其他依赖中包含了该配置
Ctrl+Alt+Shift+U打开依赖树,Ctrl+F找到spring-boot-starter-web并单击
在这里插入图片描述
可以看到spring-boot-starter-web来自于spring-cloud-starter-netflix-hystrix-dashboard
在这里插入图片描述
因此从子项目pom.xml中剔除该依赖即可

        <dependency>
            <groupId>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值