Community
Participate
Working Groups
Build Identifier: 2.1.1.v20100817-r8050 Symptoms: - When creating an entity manager for the first time for the persistence unit multiple Descriptor Exceptions are thrown: -- DatabaseSessionImpl throws an IndexOutOfBoundsException in initializeDescriptors() (caused by ObjectBuilder.getPrimaryKeyClassifications()) -- ClassDescriptor.getTable() throws a Descriptor Exception - In each case the exception description is: The table [<Name of the table the @ManyToMany relation maps to>] is not present in this descriptor Reason: - org.eclipse.persistence.internal.libraries.asm.ClassReader of the embedded ASM library silently fails to load the eclipselink annotations from the persistent field in method accept(ClassVisitor, Attribute[], boolean) when the field is annotated with an annotation that has RetentionPolicy.CLASS Workaround: - Do not annotate persistent fields in Entity classes with annotations invisible at runtime (that is: have RetentionPolicy.CLASS) We notice that the version of ASM embedded in EclipseLink seems to be much older than the official version of ASM at http://asm.ow2.org/ Note: - We could never reproduce the behavior when running the code from within Eclipse. Only when running it from an ant script. - We set severity to major, because this bug is very hard to track down. Reproducible: Always Steps to Reproduce: - Create a persistent class with a @ManyToMany mapping. Define this mapping via annotations. - Add an additional annotation with RetentionPolicy.CLASS to the field that holds the many-to-many mapping (for example the FindBugs @GuardedBy annotation).
See also Bug 324862 https://bugs.eclipse.org/bugs/show_bug.cgi?id=324862. Which contains a patch that probably will also fix this problem.
Setting target and priority. See the following page for details of the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
This can happen with any additional attributes on a member, we encountered it with aspectj method line number attributes. MetadataAsmFactory.addAnnotations is assuming the runtime annotations are going to be the first Attribute, but they can appear anywhere in the list. It needs to run through all the Attributes and add any RuntimeVisibleAnnotations that appear This issue is a duplicate of 304602, just manifesting itself in a different situation.
Also see bug id 324862. This appears to be the same issue. I am posting our version of the fix there.
*** Bug 330650 has been marked as a duplicate of this bug. ***
Duplicate bug which has now been resolved. *** This bug has been marked as a duplicate of bug 304602 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink