报错信息:

***************************
APPLICATION FAILED TO START
***************************
 
Description:
 
Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.
 
 
Action:
 
Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

网上有人说:

原因:
依赖冲突,spring-cloud-starter-gateway与spring-boot-starter-web和spring-boot-starter-webflux依赖冲突

解决:
排除 spring-boot-starter-web和spring-boot-starter-webflux依赖
 

但是我并没有添加这两个依赖,后发发现,

网关gateway添加了依赖:

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-hateoas</artifactId>
     <version>2.1.2.RELEASE</version>
 </dependency>

该依赖中有web依赖,导致冲突。去除该依赖即可

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐