caused By:java.lang.NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName () ljava/lang/string;
ContainerBase.addChild:start:
org.apache.catalina.LifecycleException:Failed to start component [Standardengine[catalina]. Standardhost[localhost]. Standardcontext[]]
Problems with the Tomcat jar package when MAVEN is packaged
Springboot has its own tomcat bag
Set as follows:
<Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-tomcat</Artifactid> <Scope>Provided</Scope></Dependency>
Phenomenon: I am using Spring-boot 1.3.3.RELEASE version, with Tomcat is 8.x, do not set scope=provide directly packaged, run under TOMCAT8 is no problem, but run under TOMCAT7 will report the above error.
Resolution process: I repeatedly compared to the spring-boot-starter-tomcat and did not pack the Lib difference, found in Tomcat7, There are Tomcat-jdbc-8.0.32.jar and Tomcat-juli-8.0.32.jar that can run, if there are more than Tomcat and the like, there will be a conflict, so that Tomcat can not run successfully, the problem becomes as long as the dependency of the Tomcat to remove the extra jar package on the line , with these two jar packages you can guarantee the normal dependency of some springboot other packages. But it took almost 4 hours to solve this simple problem, shame ...
Special Note: If the last item that needs to be packaged is dependent on several other projects, and the dependency of Tomcat is on other projects, it is best to clean the entire project first, then build the other jars separately, and finally package the war package, otherwise it will not be effective to package the final project directly.
Painful summary: This is a tool using habits caused by the simple problem of complex problems, very simple problem, the results of all methods have been tried, and finally found that not many methods are useless, but their own use of the problem caused by the use of habits.
Just like the eyes are covered with black cloth, thinking that they are blind, the results to eat all kinds of panacea, the result is still a dark eye, in fact, as long as take off the black cloth on it, but hard to do so much of the work of the useless.
In fact, as long as you modify the dependency needs to build the jar package of the project, must first clean, then generate in turn, even if this method is not successfully resolved, and then test other methods, you must remember clean and install
Org.apache.catalina.LifecycleException:Failed to start component [Standardengine[catalina]. Standard