gateway报错信息:
Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.
Gateway报错:Spring MVC found on classpath, which is incompatible with Spring Cl1.png
解决方法:
产生问题原因:Gateway 不支持spring boot web
找到pom文件,把spring-boot-starter-web删除即可
删除以下两个依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

然后刷新maven,再次启动就不报错了

Last modification:June 29, 2020
如果觉得这篇技术文章对你有用,请随意赞赏