小工具知识网

当前位置: 首页 > 行业知识 > 解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

行业知识

解决Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

2026-11-05 21:46:43 来源:互联网转载

gateway运行时报错


原因很明显:SpringMVC和SpringCloudGateway不共存,但是我子项目pom文件根本没有spring-boot-starter-web,是从父项目继承过来的


解决方法①:在application.yml添加spring.main.web-application-type=reactive

格式如图

解决方法②:用exclusions排除spring-boot-starter-web依赖

                    org.springframework.boot            spring-boot-starter-web                                                *                    *                                    

上一篇:国战服务器怎么做?

下一篇:微擎小程序打包攻略,轻松上手,一键搞定,助力开发者极速部署!