91名师指路-头部
91名师指路

org.springframework.http.codec.ServerCodecConfigurer that could not be found

由于某些原因,现在不支持支付宝支付,如需要购买源码请加博主微信进行购买,微信号:13248254750

一:springcloud alibaba 集成gateway我们需要引入

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


二:报错信息如下

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.


三:错误原因:因为spring-cloud-starter-gateway用的是webflux里面已经包含了spring-boot-starter-web,解决办法:在spring-cloud-starter-gateway里面将spring-boot-starter-web排除掉,如下所示

<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>
</exclusions>
</dependency>





2022-05-08 23:02:12     阅读(1361)

名师出品,必属精品    https://www.91mszl.com

联系博主    
用户登录遮罩层
x

账号登录

91名师指路-底部