spring-cloud-starter-gateway本身包含了web,发生了冲突

2022-07-01 08:56:32

spring-cloud-starter-gateway本身包含了web,发生了冲突

在项目中引入springcloud中的gateway时报以下错误
在这里插入图片描述
可能原因:spring-cloud-starter-gateway已经包含了web,发生了冲突

因为gateway和zuul不一样,gateway用的是长连接,netty-webflux,zuul1.0用的就是同步webmvc。所以你的非gateway子项目启动用的是webmvc,你的gateway启动用的是webflux. spring-boot-start-web和spring-boot-start-webflux相见分外眼红。不能配置在同一pom.xml,或者不能在同一项目中出现。–摘自网上
在这里插入图片描述
或者: 检查一下spring cloud 的版本与spring boot 的版本是否兼容

链接:官网地址 https://spring.io/projects/spring-cloud.
在这里插入图片描述

解决方法:将pom文件中的spring-boot-starter-web 移除

  • 作者:遗~憾
  • 原文链接:https://blog.csdn.net/weixin_43084829/article/details/119880564
    更新时间:2022-07-01 08:56:32