spring boot 启动 nested exception is java.lang.IllegalStateException

  • Post author:
  • Post category:java


在启动spring boot 项目时报错,之前都是OK的,只是我引用了内置的tomcat包就报错了

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

231256_vcMM_2431191.png

网上搜索了一下,需要把scope改成编译方式即可!

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

友情提示:最好是不要引用内置tomcat,有坑?


转载于:https://my.oschina.net/alarm1673/blog/1808539