首页 > 解决方案 > Spring Boot 无法启动 Web 服务器

问题描述

我有一个不寻常的问题,我们有一个 Spring Boot 项目,该项目适用于除我之外的每个人的开发环境。我得到的错误是:

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157) ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]

我们已经尝试从这里创建一个 vanilla web 项目:https ://start.spring.io/并尝试以相同的错误启动生成的项目。

我看不到这是项目的配置错误,因为

  1. 它是由 spring 从 spring 网站配置的
  2. 它适用于除我之外的其他所有人的 IDE

我尝试了具有相同 JDK (jdk1.8.0_121) 的各种版本的 STS IDE 我已将 STS IDE 更新到 3.9.7,但它仍然失败 - 这是与同事相同的配置。

这是应用程序:

@SpringBootApplication
public class DemoApplication {

  public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }
}

标签: springspring-boot

解决方案


推荐阅读