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

使用springcloud alibaba gateway运行出现 Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.

在这里插入图片描述
geteway内部是通过netty+webflux实现的,webflux实现和springmvc配置依赖冲突。
依赖修改为
在这里插入图片描述

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-webflux</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

版权声明:本文为weixin_50971499原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。