springCloud-Gateway 出现org.springframework.http.codec.ServerCodecConfigurer‘ that could not be found

2022-07-04 10:58:38

springCloud-Gateway 出现org.springframework.http.codec.ServerCodecConfigurer’ that could not be found错误

Spring MVC与Spring Cloud网关不兼容。请删除spring-boot-start-web依赖项。
因为spring cloud gateway是基于webflux的,如果非要web支持的话需要导入spring-boot-starter-webflux而不是spring-boot-start-web。

或者添加

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId></exclusion></exclusions></dependency>
  • 作者:Jon_hao
  • 原文链接:https://blog.csdn.net/mighty_Jon/article/details/110233399
    更新时间:2022-07-04 10:58:38