springcloud gateway网关服务启动报错

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:11   3188   0

集成gateway

springcloud网关集成gateway服务

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>

报错:

原因分析:

因为gateway集成的是webflux,不是springmvc,不能依赖,只需要添加gateway依赖包即可,其余不用多加

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

同时,gateway与springmvc框架不兼容,需移除springmvc的依赖(仔细检查某个包是否有springmvc的依赖)

<exclusions>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </exclusion>
</exclusions>

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP