Objective:
Project description, this project is a MAVEN multi-module project, module Project: All (parent module), Util (Common tool Class), DAO (Entity class, Business class, Mapper, Mapper.xml); Business (service service); App-root (is a parent project that contains backend, PC, Mobile, schedule) ...
Structure diagram:
All +--App-root +- -app-backend --app-pc --app-Mobile --app- Schedule-- Business-- DAO--Util
Error:
Error description, I put the App-backend project with MAVEN into a war package, uploaded to the production of Tomcat, Tomcat can start normally. However, the visit was reported at 404.
Workaround:
1. on the startup class of the App-backend project, add the following code:
@Override protected Springapplicationbuilder Configure (Springapplicationbuilder application) { return Application.sources (appbackendapplication. Class);}
2, in the App-backend project Pom.xml, modify the following dependencies.
<Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-web</Artifactid> <!--Ignore inline tomcat and package deployment to Tomcat. Note * local run time to ignore this paragraph to introduce a comment out, or the project can not start - <Exclusions> <exclusion> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-tomcat</Artifactid> </exclusion> </Exclusions></Dependency>
Summarize:
I passed the above two steps and the problem was solved. The reason for the error is that the Springboot embedded Tomcat is in conflict with our Tomcat container. I hope I can help the people who have read this article.
Springboot project into a war package, deployed to Tomcat, normal start access error 404