springboot集成springCloud中gateway时启动报错

在项目中引入springcloud中的gateway时报以下错误

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-cloud-starter-gateway与spring-boot-starter-web和spring-boot-starter-webflux依赖冲突

解决方式:在引入gateway时过滤掉上面两个依赖

 
            org.springframework.cloud
            spring-cloud-starter-gateway
            
                
                    org.springframework.boot
                    spring-boot-starter-web
                
                
                    org.springframework.boot
                    spring-boot-starter-webflux
                
            
        

你可能感兴趣的:(springboot集成springCloud中gateway时启动报错)