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>
本文介绍了解决SpringCloud Gateway中出现的'org.springframework.http.codec.ServerCodecConfigurer'未找到错误的方法。通过排除Spring WebMVC依赖或引入Spring Boot Starter WebFlux来确保与SpringCloud Gateway兼容。
2万+

被折叠的 条评论
为什么被折叠?



