Spring Cloud Gateway报错:Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time...

2020-06-29T15:44:00

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 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,再次启动就不报错了

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »