springboot项目在启动时需要把servlet容器编译进去,这时候如果你的maven依赖里面没有配置jetty或者tomcat相关依赖就会报错。

解决方法:

jetty添加

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
    <scope>provided</scope>
</dependency>

tomcat添加:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    <scope>provided</scope>
</dependency>

 

相关文章:

  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-01-16
  • 2021-07-27
  • 2021-05-25
猜你喜欢
  • 2021-12-24
  • 2021-12-13
  • 2021-12-19
  • 2021-08-04
相关资源
相似解决方案