1. 程式人生 > >spring-boot-starter-web包,會導致Gateway啟動拋出異常

spring-boot-starter-web包,會導致Gateway啟動拋出異常

code pre pid 實現 group boot 因此 添加 artifact

最近在用springcloud搭建一個web應用時,發現如果添加不要引入spring-boot-starter-web包,會導致Gateway啟動拋出異常,故使用

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
就不需要添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--<version>2.1.1.RELEASE</version>-->
</dependency>


網上查了一下發現:Spring Cloud Gateway 是使用 netty+webflux 實現因此不需要再引入 web 模塊。

spring-boot-starter-web包,會導致Gateway啟動拋出異常