Tomcat类路径包含重复的Catalina Server.class

问题描述

尝试运行springboot应用程序,但遇到一个问题,告诉我“更正应用程序的类路径,使其包含org.apache.catalina.Server的单个兼容版本”,我看不到任何内容。依赖关系树,它表示重复的依赖关系。我还尝试从下面的核心依赖项中排除j2ee groupId,但无济于事。

POM

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>*The Group id*</groupId>
<artifactId>*the artifact id*</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>my-project</name>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>*the group id*</groupId>
        <artifactId>core</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
        <version>2.3.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.3.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ibatis</groupId>
        <artifactId>ibatis-sqlmap</artifactId>
        <version>2.3.4.726</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        </exclusions>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

错误

Description:
An attempt was made to call a method that does not exist. The attempt was made from the following 
location:
org.apache.catalina.startup.Tomcat.initBaseDir(Tomcat.java:888)

The following method did not exist:

org.apache.catalina.Server.setCatalinaBase(Ljava/io/File;)V

The method's class,org.apache.catalina.Server,is available from the following locations:

jar:file:/.m2/repository/j2ee/j2ee/1.0/j2ee-1.0.jar!/org/apache/catalina/Server.class
jar:file:/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.38/tomcat-embed-core-9.0.38.jar!/org/apache/catalina/Server.class

The class hierarchy was loaded from the following locations:

org.apache.catalina.Server: file:/.m2/repository/j2ee/j2ee/1.0/j2ee-1.0.jar


Action:

Correct the classpath of your application so that it contains a single,compatible version of org.apache.catalina.Server

任何帮助将不胜感激。谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...