springboot ---坑 tomcat部署springboot 一直运行不起来

1、首先部署springboot项目的tomcat的版本必须在8.0之后

2、springboot 同样是基于maven的,那么在pom.xml中的tomcat的依赖:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>tomcat-embed-el</artifactId>
<groupId>org.apache.tomcat.embed</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-embed-websocket</artifactId>
<groupId>org.apache.tomcat.embed</groupId>
</exclusion>
</exclusions>
</dependency>

3、这个地方就是坑了,不仅仅tomcat的版本要在8.0之上,就连javaee的版本也要在8.0及以上

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
</dependency>

其他基础必备的,加上这些坑就应该ok的了

原文地址:https://www.cnblogs.com/haoxiu1004/p/10308511.html