场景,某天gateway突然无法启动 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
  1. 经过排查是引用的common包里添加了 spring-webmvc 的jar包,把该jar包排除即可
 		<dependency>
            <groupId>com.xxx.xxx</groupId>
            <artifactId>xxx-common</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-webmvc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

参考:https://blog.devmgr.cn/2020/02/16/spring-gateway-%E9%81%87%E5%88%B0%E5%BC%82%E5%B8%B8unable-to-start-servletwebserverapplicationcontext-due-to-missing-servletwebserverfactory-bean-%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8/

Logo

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

更多推荐