问题描述:
在使用spring-cloud-starter-gateway时常会报一下错误:
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
这是因为,gateway依赖的webflux与spring-webmvc冲突所致,只需要找到引入spring-webmvc的包,将其排除即可。
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
</exclusions>