错误案例

 

产生的原因

原因是因为spring cloud gateway 是建立在spring boot 2.x 和 spring webflux基础上的既:gateway 本身已经包含了spring mvc 的功能,正与提示的一样和spring boot 的web starter冲突了

解决方式

找到gateway下面的spring-boot-starter-web依赖,然后将其注释掉

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>


 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐