1異常如下
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.
2原因:
Spring Cloud Gateway 是使用 netty+webflux實(shí)現(xiàn),webflux與web是沖突的压彭,所以依賴中肯定有web的依賴
3解決方式:
在類路徑上找到的Spring MVC双谆,此時(shí)它與Spring Cloud網(wǎng)關(guān)不兼容。請(qǐng)刪除spring-boot-start-web依賴項(xiàng)兴枯,如果非要web支持的話需要導(dǎo)入spring-boot-starter-webflux而不是spring-boot-start-web血淌。