gateway运行时报错
原因很明显:SpringMVC和SpringCloudGateway不共存,但是我子项目pom文件根本没有spring-boot-starter-web,是从父项目继承过来的
解决方法①:在application.yml添加spring.main.web-application-type=reactive
解决方法②:用exclusions排除spring-boot-starter-web依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>*</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency>