sprigboot 异常 Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].Tomc...
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
![image.png](https://upload-images.jianshu.io/upload_images/18296616-d2ff59591ac519e6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency>
问题解决!
升级springboot2.x后 ,又出现了这个问题,在依赖中有两个同名版本不一致的。
![image.png](https://upload-images.jianshu.io/upload_images/18296616-8bb746e0e4bd3444.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
在这里删掉:
![image.png](https://upload-images.jianshu.io/upload_images/18296616-b70d259e6f0a3715.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)