当前位置: 代码迷 >> 综合 >> 【微服务】 网关启动报错 Consider defining a bean of type org.springframework.http.codec.ServerCodecConfigurer
  详细解决方案

【微服务】 网关启动报错 Consider defining a bean of type org.springframework.http.codec.ServerCodecConfigurer

热度:73   发布时间:2023-09-21 00:22:13.0

一、现象

微服务启动时报错:Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer'

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-11 14:21:30.165 ERROR 22456 --- [           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-boot-starter-web 的依赖,而 SpringCloudGateway 还不支持 spring-boot-starter-web

 

三、解决方案

将这个依赖排除

 

 

 

  相关解决方案