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

本文详细描述了在SpringBoot项目中遇到的Hibernate尝试调用不存在的方法错误,该问题源于JPA版本冲突。文章提供了具体的错误信息及解决方案,包括如何定位并移除重复的jar包,以确保应用类路径中只有一个兼容的javax.persistence.Table版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Description:

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:1236)

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:

    jar:file:/E:/springboot/sprintboot01/codes/codes/14/AYZXX-A/lib/javax.persistence.jar!/javax/persistence/Table.class
    jar:file:/C:/Users/zhongxiaoxia/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar!/javax/persistence/Table.class

It was loaded from the following location:

    file:/E:/springboot/sprintboot01/codes/codes/14/AYZXX-A/lib/javax.persistence.jar


Action:

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

 1,最近刚学IDEA,对这个工具不是很熟,项目报错,上网查,有的说是版本冲突,也有的说是jar重复,经检验,jar包重复。

需要删除:

 file:/E:/springboot/sprintboot01/codes/codes/14/AYZXX-A/lib/javax.persistence.jar

而不要删除:

  jar:file:/E:/springboot/sprintboot01/codes/codes/14/AYZXX-A/lib/javax.persistence.jar!/javax/persistence/Table.class
    jar:file:/C:/Users/zhongxiaoxia/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar!/j

这是实验所得, 原因未知。

 

评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值