Community
Participate
Working Groups
Set the following persistence unit in any of our test persistence units and run the tests <property name="eclipselink.weaving.fetchgroups" value="false"/> You will see an exception like this: java.lang.VerifyError: (class: org/eclipse/persistence/testing/models/jpa/delimited/Project, method: setVersion signature: (I)V) Register 2 contains wrong type at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:93) at org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1258) at org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:367) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:338) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:230) at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.createEntityManager(JUnitTestCase.java:347) at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testPopulate(DelimitedPUTestSuite.java:62) 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 junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:503) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Running with the system properties: eclipselink.weaving.output.path=<path> eclipselink.weaving.overwrite.existing=true Will output the classes as they are weaved. Decompile those classes and you will see that the class is inproperly built
This issue occurs in persistence units where the following is true 1. PROPERTY access is used 2. The underlying field represented by the property does not have the same name as the property. (e.g. m_budget is the field name and getBudget/setBudget are the method names) 3. The property is a java primitive
Created attachment 188515 [details] Proposed Fix - more testing required
Checked in weaver fix for issue with fetch group weaving disabled. I have tested this manually, but this check-in will be properly tested by some changes the QA team is providing and the check-in facilitates running their testing. The changes only affect persistence units with eclipselink.weaving.fetch-groups=false Initial check-in to trunk only pending tests.
QA test verifys improvement. Checking into 2.2 stream as well.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink