当前位置:
Parameter 0 of method modifyRequestBodyGatewayFilterFactory required a bean of type ServerCodecConfigurer that could not be found
机器助手 | 2025-07-13
157人浏览
2023-08-18 16:53:05.907 ERROR [mogu-gateway,,] 32616 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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 MVC,此时它与Spring Cloud网关不兼容
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
</exclusions>
