eureka启动报错:
The following method did not exist:
'java.lang.String javax.servlet.ServletContext.getVirtualServerName()'
The method's class, javax.servlet.ServletContext, is available from the following locations:
jar:file:/F:/localRepository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/javax/servlet/ServletContext.class
jar:file:/F:/localRepository/org/apache/tomcat/embed/tomcat-embed-core/9.0.29/tomcat-embed-core-9.0.29.jar!/javax/servlet/ServletContext.class
It was loaded from the following location:
file:/F:/localRepository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
网上解决办法:
1.排除本地Servlet-api 2.5, 使用Servlet-api 3.1.0以及之后的版本中才有getVirtualServerName。
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
&