Spring Cloud GateWay 网关启动异常


错误信息:

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.

启动spring cloud 网关的时候出现错误

 

 

问题解决:

经查找是由于spring cloud的网关与spring web不兼容导致

idea中查看maven标签下所在模块的Dependencies,发现依赖中存在

所以在所在模块的pom中排除依赖,问题得到解决

<exclusions>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </exclusion>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </exclusion>
</exclusions>

这两个jar包来自哪个模块,就在哪里排除


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM