Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

Posted itLaity

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.相关的知识,希望对你有一定的参考价值。

生命无罪,健康万岁,大家好我是laity。

开发中问题梳理

报错1

Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

报错2

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

中文描述

无法启动网络服务器;嵌套异常是 org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean。

由于缺少 ServletWebServerFactory bean,无法启动 ServletWebServerApplicationContext。

本人解决方案

仅供参考

发生 网络异常报错说明本地服务提不起来,也检查了很久,最后在pom文件发现了端倪;

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <!-- 移除自带内置tomcat -->
<!--            <exclusions>-->
<!--                <exclusion>-->
<!--                    <artifactId>spring-boot-starter-tomcat</artifactId>-->
<!--                    <groupId>org.springframework.boot</groupId>-->
<!--                </exclusion>-->
<!--            </exclusions>-->
        </dependency>

通过取消移除内置的tomcat成功解决了该报错,希望对你有所帮助!!!

以上是关于Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.的主要内容,如果未能解决你的问题,请参考以下文章

Android Studio - Unable to create Debug Bridge: Unable to start adb server: adb server version (32)

The required Server component failed to start so Tomcat is unable to start解决之一

SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFact

Tomcat unable to start within 45 seconds.

Error Unable to start the Genymotion virtual device.解决

unable to retrieve audiotrack pointer for start 怎么回事儿