ERROR 30624 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :

问题描述

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-08-27T10:54:06.452+08:00 ERROR 30624 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context.

Action:

Check your application's dependencies for a supported servlet web server.
Check the configured web application type.


解决方法

首先,是先看自己的pom文件是否引入了web依赖,如果没有引入的话。

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

 如果问题没有解决的话,还有一种就是tomocat的问题,看父pom中是否将tomocat排除了。

这种情况产生的原因就是:

Spring Boot 需要一个嵌入式 Web 服务器来启动 Web 应用程序。默认情况下,Spring Boot 使用 Tomcat 作为嵌入式服务器。如果你排除了 spring-boot-starter-tomcat,并且没有添加其他嵌入式 Web 服务器(如 Undertow 或 Jetty),那么 Spring Boot 会抛出这个错误。

解决方法就是使用其他的嵌入式Web服务器(如 Undertow 或 Jetty)

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值