Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

2023-05-16

生命无罪,健康万岁,大家好我是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成功解决了该报错,希望对你有所帮助!!!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean. 的相关文章

随机推荐