springboot报错Unable to start EmbeddedWebApplicationContext due

mjjackey

关注

阅读 102

2022-08-17

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>

 

精彩评论(0)

0 0 举报