ObjectDB ObjectDB

Unable to convert 1.x odb file to 2.x

#1

Hi,

my company is just about to switch from ObjectDB 1.04.2487 (SE) to ObjectDB 2. So I downloaded the objectdb-2.5.5_02, activated it with our licence, enhancing went well, but then on converting 1 of the DB files I got this error:

java -jar converter.jar ../old.odb ../new.odb
ObjectDB 1.0 -> 2.0 file conversion
Exception in thread "main" java.lang.RuntimeException: Internal Exception
at com.objectdb.conv1.type.OldTypeInfo.skipElement(OldTypeInfo.java:266)
at com.objectdb.conv1.type.OldTypeManager.skipElement(OldTypeManager.java:222)
at com.objectdb.conv1.type.OldUpgradeProgram.upgrade(OldUpgradeProgram.java:194)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:437)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldCollectionTypeInfo.convertObject(OldCollectionTypeInfo.java:95)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertObject(ConvertManager.java:478)
at com.objectdb.conv1.store.OldDataMultiPage.convertObjects(OldDataMultiPage.java:107)
at com.objectdb.conv.ConvertManager.convertAllObjects(ConvertManager.java:440)
at com.objectdb.conv.ConvertManager.run(ConvertManager.java:210)
at com.objectdb.conv.ConvertManager.main(ConvertManager.java:161)
at com.objectdb.Converter.main(Converter.java:26)

Please advice how to solve this.

edit
delete
#2

I tried the conversion on another odb file which is 3G in size and I think half of it was converted. The output is much longer (see it in attachment). The interesting exception in it was this:

Exception in thread "main" com.objectdb.o.TEX: Type [Ljava.lang.String; is not found
at com.objectdb.o.MSG.e(MSG.java:107)
at com.objectdb.o.TYM.ay(TYM.java:1017)
at com.objectdb.o.TYM.aq(TYM.java:829)
at com.objectdb.conv.ConvertManager.getNewType(ConvertManager.java:346)
at com.objectdb.conv1.type.OldTypeInfo.tryWritingEmpty(OldTypeInfo.java:398)
at com.objectdb.conv1.type.OldObjArrayTypeInfo.convertObject(OldObjArrayTypeInfo.java:81)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldMapTypeInfo.convertObject(OldMapTypeInfo.java:93)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldCollectionTypeInfo.convertObject(OldCollectionTypeInfo.java:95)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:504)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:459)
at com.objectdb.conv.ConvertManager.convertObject(ConvertManager.java:478)
at com.objectdb.conv1.store.OldDataMultiPage.convertObjects(OldDataMultiPage.java:107)
at com.objectdb.conv.ConvertManager.convertAllObjects(ConvertManager.java:440)
at com.objectdb.conv.ConvertManager.run(ConvertManager.java:210)
at com.objectdb.conv.ConvertManager.main(ConvertManager.java:161)
at com.objectdb.Converter.main(Converter.java:26)
Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;
at com.objectdb.o.TYM.findClass(TYM.java:1033)
at com.objectdb.o.ACL.loadClass(ACL.java:131)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.objectdb.o.TYM.ay(TYM.java:1013)
... 26 more
edit
delete
#3

Your report shows two different issues.

Please try build 2.5.5_04 that includes an attempt to fix them.

ObjectDB Support
edit
delete
#4

Thanks for the fix. It helped for the above mistakes, but next one raised 200MB further in the DB file:

 

.................................................. 100MB
.................................................. 200MB
.................................................. 300MB
.................................................. 400MB
.................................................. 500MB
.................................................. 600MB
.................................................. 700MB
.................................................. 800MB
.................................................. 900MB
.................................................. 1000MB
.................................................. 1100MB
.................................................. 1200MB
.................................................. 1300MB
.................................................. 1400MB
.................................................. 1500MB
.................................................. 1600MB
......Exception in thread "main" com.objectdb.o.TEX: Type [B is not found
at com.objectdb.o.MSG.e(MSG.java:107)
at com.objectdb.o.TYM.ay(TYM.java:1017)
at com.objectdb.o.TYM.aq(TYM.java:829)
at com.objectdb.conv.ConvertManager.getNewType(ConvertManager.java:346)
at com.objectdb.conv1.type.OldTypeInfo.tryWritingEmpty(OldTypeInfo.java:398)
at com.objectdb.conv1.type.OldPrmArrayTypeInfo.convertObject(OldPrmArrayTypeInfo.java:77)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:530)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:485)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldCollectionTypeInfo.convertObject(OldCollectionTypeInfo.java:95)
at com.objectdb.conv.ConvertManager.convertElement(ConvertManager.java:560)
at com.objectdb.conv1.type.OldUserTypeInfo.convertFieldValue(OldUserTypeInfo.java:530)
at com.objectdb.conv1.type.OldUserTypeInfo.convertObject(OldUserTypeInfo.java:485)
at com.objectdb.conv.ConvertManager.convertObject(ConvertManager.java:478)
at com.objectdb.conv1.store.OldDataMultiPage.convertObjects(OldDataMultiPage.java:107)
at com.objectdb.conv.ConvertManager.convertAllObjects(ConvertManager.java:440)
at com.objectdb.conv.ConvertManager.run(ConvertManager.java:210)
at com.objectdb.conv.ConvertManager.main(ConvertManager.java:161)
at com.objectdb.Converter.main(Converter.java:26)
Caused by: java.lang.ClassNotFoundException: [B
at com.objectdb.o.TYM.findClass(TYM.java:1033)
at com.objectdb.o.ACL.loadClass(ACL.java:131)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.objectdb.o.TYM.ay(TYM.java:1013)
... 18 more
edit
delete
#5

Please try build 2.5.5_05 and hopefully you will get further now.

ObjectDB Support
edit
delete
#6

Great, thx. This time I got considerably further. My ODB files got converted completely. Although in the result appeared some broken references but only in one particular class.

Output of conversion:

ObjectDB 1.0 -> 2.0 file conversion
.................................................. 100MB
.................................................. 200MB
.................................................. 300MB
.................................................. 400MB
.................................................. 500MB
.................................................. 600MB
.................................................. 700MB
.................................................. 800MB
.................................................. 900MB
.................................................. 1000MB
.................................................. 1100MB
.................................................. 1200MB
.................................................. 1300MB
.................................................. 1400MB
.................................................. 1500MB
.................................................. 1600MB
.................................................. 1700MB
.................................................. 1800MB
.................................................. 1900MB
.................................................. 2000MB
.................................................. 2100MB
.................................................. 2200MB
.................................................. 2300MB
.................................................. 2400MB
.................................................. 2500MB
.................................................. 2600MB
.................................................. 2700MB
.................................................. 2800MB
.................................... 2873MB (total)
File has been converted successfully (Time: 301 seconds)
Broken references have been found:
  Type eu.extech.quant.data.user_attribute.UserAttributesMap, field "map" -> 12 broken references
More information can be found in the log

Relevant part from the log file:

[2014-05-06 10:58:29 #53 type.registry]
New type eu.extech.quant.data.user_attribute.UserAttributesMap

[2014-05-06 10:58:29 #54 type]
Type eu.extech.quant.data.user_attribute.UserAttributesMap is not enhanced.

...

[2014-05-06 10:58:36 #285 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#839611 -> 2230757

[2014-05-06 10:58:36 #286 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#839609 -> 2329077

[2014-05-06 10:58:36 #287 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#839609 -> 2328999

[2014-05-06 11:02:13 #288 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#665091 -> 2329067

[2014-05-06 11:02:13 #289 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#665142 -> 2853361

[2014-05-06 11:02:35 #290 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#827031 -> 2558447

[2014-05-06 11:02:35 #291 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#827031 -> 2198001

[2014-05-06 11:02:35 #292 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#827032 -> 2853361

[2014-05-06 11:02:45 #293 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#839605 -> 2230773

[2014-05-06 11:02:45 #294 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#839613 -> 2329067

[2014-05-06 11:02:56 #295 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#941824 -> 2329067

[2014-05-06 11:03:18 #296 *] 
Broken ref: map@eu.extech.quant.data.user_attribute.UserAttributesMap#1022636 -> 2722283

---------------------------------------------------------------------------------------------

 

The content of the field 'map' (which is originally a HashMap<String, Object>) got messed up badly:

  • one key converted from a String to null
  • one value converted from String[] to an instance of another class not related by any means to the object to be converted
  • another value from Object[] containing 2 String-s converted to Object[] containing null and again an instance of an unrelated class

I made screenshots from old and new Explorer to show this one object which I described in original and converted form. Pls check the attachments.

I believe this could be caused by having an array of objects as the value in the HashMap. Can this be fixed too? 

edit
delete
#7

This map issue would be much more difficult to fix, since no exception with a stack trace is available now. Therefore, we may need a sample database that demonstrates the problem in order to explore it, and it is unclear if we can provide a quick solution.

If the converter converts 99% of your data successfully, it would be better if you can complete the remaining 1% by your own simple console application that would port any problematic data.

ObjectDB Support
edit
delete
#8

Thanks for your help. The issue with the object array in a map I will solve via some migration to a structure where the value in the map will be a user defined class containing the array.

edit
delete

Reply

To post on this website please sign in.