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
这是实验所得, 原因未知。

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

被折叠的 条评论
为什么被折叠?



