Generally, the Springboot project runs the main function in the Application by default. If you want to use tomcat to start, you need to add the following configuration
public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } }