简体   繁体   English

spring 引导应用程序中的类路径错误?

[英]Classpath error in spring boot application?

Hello guys please help me out with this error when I run my spring boot app this error pops out.大家好,当我运行我的 spring 启动应用程序时,请帮我解决这个错误,这个错误会弹出。 I tried the suggested action but still not working.我尝试了建议的操作,但仍然无法正常工作。

Dependency依赖

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.session</groupId>
        <artifactId>spring-session-core</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </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>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    </dependencies>

An attempt was made to call a method that does not exist.试图调用不存在的方法。 The attempt was made from the following location:尝试是从以下位置进行的:

org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:1238)

The following method did not exist:以下方法不存在:

javax.persistence.Table.indexes()[Ljavax/persistence/Index;

The method's class, javax.persistence.Table, is available from the following locations:该方法的 class、javax.persistence.Table 可从以下位置获得:

jar:file:/C:/Users/INTEL/Desktop/timetablesystem/lib/javax.persistence.jar!/javax/persistence/Table.class
jar:file:/C:/Users/INTEL/.m2/repository/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar!/javax/persistence/Table.class

The class hierarchy was loaded from the following locations: class 层次结构是从以下位置加载的:

javax.persistence.Table: file:/C:/Users/INTEL/Desktop/timetablesystem/lib/javax.persistence.jar

Action:行动:

Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.Table更正应用程序的类路径,使其包含一个兼容的 javax.persistence.Table 版本

You need to remove C:/Users/INTEL/Desktop/timetablesystem/lib/javax.persistence.jar from the classpath of your application as it contains an old version of the Java Persistence API that is incompatible with the version of Spring Boot that you're using. You need to remove C:/Users/INTEL/Desktop/timetablesystem/lib/javax.persistence.jar from the classpath of your application as it contains an old version of the Java Persistence API that is incompatible with the version of Spring Boot that you '正在使用。 Exactly how that should be done depends on how you're running your application.具体应该如何完成取决于您运行应用程序的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM