DB reading fails in debug mode in Eclipse

#1

Hello,

I got an unpleasant bug which turned into a serious issue. Using ObjectDB 2.6.9.b08 on Linux.

Here is the structure (JDO metadata) of 3 classes which I am storing as values in a HashMap of another entity in the DB.

<jdo>
<package name="my.example.package">
 
  <class name="InnerSettings">
   <field name="attributes" embedded="true">
    <map embedded-key="true" embedded-value="true" />
   </field>
  </class>
 
  <class name="BasicSettings">
   <field name="userRoles" embedded="true"/>
   <field name="innerSettings" embedded="true">
    <map embedded-key="true" embedded-value="true" />
   </field>
  </class>
 
  <class name="StoreSettings" persistence-capable-superclass="BasicSettings"/>
  <class name="AnalyzeSettings" persistence-capable-superclass="BasicSettings"/>
</package>
</jdo>

As you can see the classes are not embedded, so they have their own extent and IDs in the DB.

My application works fine with them up to I try to launch it in debug mode in eclipse.

Upon reading it in debug mode I got this exception:

com.objectdb.o.UserException: Failed to construct an instance of my.example.package.AnalyzeSettings using a no-arg constructor
at com.objectdb.o.MSG.d(MSG.java:75)
at com.objectdb.o.UTY.newInstance(UTY.java:1262)
at com.objectdb.o.OBC.aM(OBC.java:949)
at com.objectdb.o.OBC.UZ(OBC.java:822)
at com.objectdb.o.TYR.aF(TYR.java:715)
at com.objectdb.o.TYR.aE(TYR.java:701)
at com.objectdb.o.TYR.completeRead(TYR.java:544)
at com.objectdb.o.TYR.readElement(TYR.java:294)
at com.objectdb.o.UTY.readAndAdjust(UTY.java:1558)
at com.objectdb.o.MPT.readArray(MPT.java:423)
at com.objectdb.o.MPT.readArray(MPT.java:403)
at com.objectdb.o.MPT.H(MPT.java:331)
at com.objectdb.o.TYT.extractMap(TYT.java:108)
at com.objectdb.o.ENT.extractMap(ENT.java:1550)
at objectdb.java.util.HashMap.__odbBeforeAccess(Unknown Source)
at objectdb.java.util.HashMap.keySet(Unknown Source)
at my.example.package.Tool.deepCopy(Tool.java:1597)
... 20 more
Caused by: com.objectdb.o.UserException: Failed to construct an instance of my.example.package.AnalyzeSettings using a no-arg constructor
at com.objectdb.o.MSG.d(MSG.java:75)
at com.objectdb.o.TYH.X(TYH.java:967)
at com.objectdb.o.UTY.newInstance(UTY.java:1258)
... 35 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.objectdb.o.TYH.X(TYH.java:963)
... 36 more
Caused by: java.lang.NoSuchMethodError: my.example.package.BasicSettings: method ()V not found
at my.example.package.AnalyzeSettings.(AnalyzeSettings.java:1)
... 41 more

 

So I added no-arg constructors to classes: AnalyzeSettings, StoreSettings, BasicSettings

and then the processing got a little further and I got this error:

java.lang.AbstractMethodError
at com.objectdb.o.OBC.ay(OBC.java:463)
at com.objectdb.o.OBC.aM(OBC.java:954)
at com.objectdb.o.OBC.UZ(OBC.java:822)
at com.objectdb.o.TYR.aF(TYR.java:715)
at com.objectdb.o.TYR.aE(TYR.java:701)
at com.objectdb.o.TYR.completeRead(TYR.java:544)
at com.objectdb.o.TYR.readElement(TYR.java:294)
at com.objectdb.o.UTY.readAndAdjust(UTY.java:1558)
at com.objectdb.o.MPT.readArray(MPT.java:423)
at com.objectdb.o.MPT.readArray(MPT.java:403)
at com.objectdb.o.MPT.H(MPT.java:331)
at com.objectdb.o.TYT.extractMap(TYT.java:108)
at com.objectdb.o.ENT.extractMap(ENT.java:1550)
at objectdb.java.util.HashMap.__odbBeforeAccess(Unknown Source)
at objectdb.java.util.HashMap.keySet(Unknown Source)
at my.example.package.Tool.deepCopy(Tool.java:1597)

 

Could u please advice me how to fix this state ?

#2

The stack trace may indicate an incomplete enhancement.

Try full clean build of your project with full enhancement of all your classes (particularly all persistence capable classes and all their ancestor classes, even if not persistence capable).

Use post compilation (build time) enhancement rather than on the fly enhancement.

ObjectDB Support

Reply