Community
Participate
Working Groups
Build Identifier: This bug occurs only on EclipseLink-2.3.0. If nested Embeddables are used, and an Embeddable contains an AttributeOverride for a field in a subordinate Embeddable, the following Exception is thrown: java.util.ConcurrentModificationException at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1385) This might have to do with runtime instrumentation, as the Exception is raised during instrumentation. The full stack trace is: Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323) at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338) Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [aerztebewertungen] failed. Internal Exception: java.util.ConcurrentModificationException at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1385) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:98) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:306) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initialize(JPAInitializer.java:265) at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializer.getJavaSECMPInitializer(JavaSECMPInitializer.java:82) at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializer.getJavaSECMPInitializerFromAgent(JavaSECMPInitializer.java:66) at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializer.initializeFromAgent(JavaSECMPInitializer.java:168) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:47) at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39) ... 6 more Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [xxx] failed. Internal Exception: java.util.ConcurrentModificationException at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:221) ... 19 more Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$KeyIterator.next(HashMap.java:828) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1597) at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:517) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1320) ... 18 more FATAL ERROR in native method: processing of -javaagent failed I will attach a simple test case with which the problem can be reproduced. Reproducible: Always Steps to Reproduce: 1. Unzip test case, and create a persistence.xml 2. Start application with runtime instrumentation 3. Observe that the Exception is not thrown when the AttributeOverrides is removed
Created attachment 206064 [details] Simple test case that reproduces the problem
To elaborate a bit on the test case: TheEntity refers to ExtendedEmbeddable, which inherits from BasicEmbeddable, which refers to Primitive with an AttributeOverride. The interesting part: @Embeddable @MappedSuperclass public class BasicEmbeddable { @Embedded @AttributeOverrides({ @AttributeOverride(name = "field", column = @Column(nullable = true)) }) private Primitive primitive; ... } @Embeddable public class Primitive { @Column(nullable = false) private double field; ... }
When you say "bug occurs only on EclipseLink-2.3.0". Do you mean the issue did not exist on previous versions?
The ConcurrentModificationException was not thrown with EclipseLink-2.1.0; instead, the AttributeOverrides was simply ignored. I have not tested with any other version of EclipseLink.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
Does the exception still occur if you remove the @Embeddable declaration on Basic Embeddable? That class shouldn't be both an @Embeddable and a @MappedSuperclass.
Correcting target milestone to next milestone that will include community-submitted bugs.
Created attachment 213600 [details] Proposed changes
Changes have been submitted. Verified by: Andrei Ilitchev Tests: Updated inherited model to expose error during metadata processing. With fix in place, error goes away and FullRegressionTestSuite passes successfully.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink