这个问题只是为了让其他人找到对EclipseLink 2.0中的错误的引用,这可以通过升级到2.4.1来解决:
在为EclipseLink的持久化实体引入通用超类后,我收到以下错误:
Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@40affc70
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.0.0.v20091127-r5931):
...
Caused by: java.lang.IndexOutOfBoundsException: Index: 12, Size: 12
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAsmFactory.resolveGenericTypes(MetadataAsmFactory.java:145)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.resolveGenericTypes(EntityAccessor.java:1332)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:316)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:610)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:593)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1296)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:460)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:390)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:940)
... 22 more
这些链接指向错误:
所以问题是:升级到2.4.1会解决这个问题吗?
我的回答是: 升级到EclipseLink 2.4.1对我有用。
答案 0 :(得分:0)
以下是maven pom.xml的摘录,确保使用Eclipselink 2.4.1:
<repositories>
<repository>
<id>eclipselink</id>
<url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo/
</url>
</repository>
</repositories>
与依赖:
<!-- Eclipse Link persistence -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.4.1</version>
<!-- <scope>provided</scope> uncomment if running inside a Java EE container -->
</dependency>