Upgrade to 2.4.1_03

#1

Right, that fix to 2.4.1_02 got us past the previous issue. Now I'm not sure whether this next issue is our annotations, or another issue with objectdb. I have added some more classes to the unit test. They are used by AbstractContactDetail.

On line 372 of the attached test, AbstractContactDetail extends AttributeHolder. If I remove the extends, the test passes. If I add it, it fails. I'm not even adding anything to AttributeHolder as part of this test.

The exception I get with the extends is:

[ObjectDB 2.4.1_03] javax.persistence.PersistenceException
Failed to clear field property com.contextspace.AddressTest$ElectronicAddress.domain using reflection (error 363)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:454)
at com.contextspace.AddressTest.test(AddressTest.java:93)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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)
Caused by: com.objectdb.o.UserException: Failed to clear field property com.contextspace.AddressTest$ElectronicAddress.domain using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:896)
at com.objectdb.o.UMR.v(UMR.java:526)
at com.objectdb.o.UML.t(UML.java:509)
at com.objectdb.o.MMM.ab(MMM.java:953)
at com.objectdb.o.UTY.aE(UTY.java:1145)
at com.objectdb.o.EMR.h(EMR.java:175)
at com.objectdb.o.TVS.Un(TVS.java:185)
at com.objectdb.o.CLT.visitRefs(CLT.java:160)
at com.objectdb.o.TVS.j(TVS.java:169)
at com.objectdb.o.TVS.cascade(TVS.java:156)
at com.objectdb.o.TVS.g(TVS.java:105)
at com.objectdb.o.TVS.g(TVS.java:93)
at com.objectdb.o.EMR.q(EMR.java:76)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:451)
... 24 more
Caused by: 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 com.objectdb.o.UMR$Z.C(UMR.java:1363)
at com.objectdb.o.UMR$Z.w(UMR.java:1357)
at com.objectdb.o.UMR.v(UMR.java:523)
... 36 more
Caused by: java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:195)
at com.contextspace.AddressTest$InstantMessagingAddress$IM_PROVIDERS.valueOf(AddressTest.java:1)
at com.contextspace.AddressTest$InstantMessagingAddress.validateDomain(AddressTest.java:718)
at com.contextspace.AddressTest$InstantMessagingAddress.setDomain(AddressTest.java:694)
... 43 more
#2

This and the previous problem result from the way that ObjectDB builds a new entity object for merge, which includes clearing the new constructed object. In this specific test case clearing the domain field to null conflicts with your checks.

To solve this problem build 2.4.1_04 avoids this clearing operation.

The clearing was added to solve another problem (of duplicating objects during merge). Actions have been taken now to solve that other problem in a different way but a regression is possible.

ObjectDB Support
#3

That seems to have got it.

Thanks

Reply