ways to recover from DB curruption



I have a database file which was mistakenly opened by a different version of my entities model and is now not usable any more.

When I try to open this file using explorer or even running the Doctor on it I get this exception:

Caused by: com.objectdb.o.UserException: Failed to generate dynamic type com.contextspace.myclass1
        at com.objectdb.o.MSG.d(MSG.java:74)
        at com.objectdb.o.ACL.d(ACL.java:166)
        at com.objectdb.o.STL.g(STL.java:97)
        at com.objectdb.o.TYM.findClass(TYM.java:1024)
        at com.objectdb.o.ACL.loadClass(ACL.java:131)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at com.objectdb.o.TYM.ax(TYM.java:1001)
        at com.objectdb.o.UTY.initSysType(UTY.java:327)
        at com.objectdb.o.TYS.l(TYS.java:163)
        at com.objectdb.o.TYM.ad(TYM.java:502)
        at com.objectdb.o.TYM.<init>(TYM.java:239)
        at com.objectdb.o.MST.aK(MST.java:179)
        at com.objectdb.o.SHN.Z(SHN.java:308)
        at com.objectdb.o.SHN.Y(SHN.java:259)
        at com.objectdb.o.SHN.K(SHN.java:123)
        at com.objectdb.o.HND.run(HND.java:133)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoClassDefFoundError: com/contextspace/myclass2
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:478)
        at com.objectdb.o.ACL.d(ACL.java:155)
        ... 15 more
Caused by: java.lang.ClassNotFoundException: com.contextspace.myclass2
        at com.objectdb.o.TYM.findClass(TYM.java:1021)
        at com.objectdb.o.ACL.loadClass(ACL.java:131)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
        ... 19 more


where in my old entity model myclass2 didn't exist and in the new model myclass1 extends myclass2.


Is there any way to recover the file by somehow reloading the previous version of the class?




Try opening the database in your application (not in the Explorer / Doctor) with the new classes and with some changes to myclass1 and myclass2 (i.e. adding a dummy field that may be later removed).

If this doesn't help and you can send the database file - it may be possible to fix it manually.

ObjectDB Support