WAR package is started in TOMCAT, and the above error is reported
Comment out JETTY related dependencies
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<scope>${jetty.scope}</scope>
</dependency>-->
Report the following error
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
View dependencies:
Found that TOCMAT related dependencies are exclusion
Comment out
<!-- spring-boot使用jetty容器配置begin -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Run again and start successfully
Package the vue project with npm run build, copy the packaged directory to the static directory of the springboot project, and then publish the entire war to tomcat
Why should springboot be published to tomcat? ?