Maven依赖冲突jar包冲突类冲突ServletContext.class

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; but it does not exist. Its class, javax.servlet.ServletContext, is available from the following locations:
尝试调用方法javax.servlet.ServletContext.getVirtualServerName();但它并不存在。它的类,javax.servlet。ServletContext,可从以下位置获得:
    jar:file:/E:/Software/apache-maven-3.5.3/repository/org/mortbay/jetty/servlet-api-2.5/6.1.14/servlet-api-2.5-6.1.14.jar!/javax/servlet/ServletContext.class
    jar:file:/E:/Software/apache-maven-3.5.3/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/javax/servlet/ServletContext.class
    jar:file:/E:/Software/apache-maven-3.5.3/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.39/tomcat-embed-core-8.5.39.jar!/javax/servlet/ServletContext.class

It was loaded from the following location:
它是从以下地点加载的:
    file:/E:/Software/apache-maven-3.5.3/repository/org/mortbay/jetty/servlet-api-2.5/6.1.14/servlet-api-2.5-6.1.14.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.servlet.ServletContext

原因:多个jar包 中包含同一个类

解决思路:可以将from the following locations:中的重复依赖仅保留一个其余改为Test或删除

jar:file:/E:/Software/apache-maven-3.5.3/repository/org/mortbay/jetty/servlet-api-2.5/6.1.14/servlet-api-2.5-6.1.14.jar!/javax/servlet/ServletContext.class
jar:file:/E:/Software/apache-maven-3.5.3/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/javax/servlet/ServletContext.class
jar:file:/E:/Software/apache-maven-3.5.3/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.39/tomcat-embed-core-8.5.39.jar!/javax/servlet/ServletContext.class

Maven依赖冲突jar包冲突类冲突ServletContext.class_第1张图片

解决思路,排除不需要的模块


    org.apache.shiro
    shiro-quartz

问题还在解决中,最好的办法是添加依赖版本时就排除冲突问题。

你可能感兴趣的:(Maven,maven,jar,servlet,redis)