Home > front end >  Springboot package into the tomcat startup success but can't access springboot programs to solv
Springboot package into the tomcat startup success but can't access springboot programs to solv

Time:09-26

Create a maven springboot project in eclipse can be run normally visit but played after the war file
In Tomcat run will not be able to access the,
Is in accordance with the normal steps to
The first: & lt; Packaging> War
The second: & lt; Dependency>
org.springframework.boot
Spring - the boot - starter - tomcat
Provided


Third:
Public class Main {
//here with tomcat startup read twice, please leave a message a great god help, solve
Public static void main (String [] args) {
SpringApplication. Run (Application class, args);
}
}
Fourth:
@ EnableTransactionManagement
@ SpringBootApplication
@ MapperScan (" com. Ykf. Mattess. Dao ")
Public class Application extends SpringBootServletInitializer {

Protected SpringApplicationBuilder configure (SpringApplicationBuilder application) {
The return application. Sources (application. The class);
}
}

To run the tomcat



And will and encountered the same problem of bosses problem under analysis

CodePudding user response:

Control layer must be started with springboot main principal classes in a package under the path

CodePudding user response:

With asked, feeling that haven't been able to scan, eclipse can be local

CodePudding user response:

Into the war and then after running locally springboot main executable program and then you in normal visit again is not an error on the server can normal boot, as an error

CodePudding user response:

Springboot spring - the boot - starter - tomcat has built-in tomcat, you want to use the external tomcat deployment, in relying on statement using external tomcat

CodePudding user response:

Meet the same problem, I put into the war tomcat8, can access, but in tomcat7, start the success, but no response, also do not appear error 404

CodePudding user response:

Meet the same problem, I put into the war tomcat8, can access, but in tomcat7, start the success, but no response, also do not appear 404 error,
Excuse me, can you solve it, this is what circumstance,
My project is to use springboot version is 1.5.14

CodePudding user response:

Need to make sure that the version of tomcat is 8 and above, the JDK is more than 8

CodePudding user response:

While you use the external tomcat, but has not ruled out springBoot embedded tomcat, this should is the cause of the problem
  • Related