ArrayIndexOutOfBoundsException

#1

Hi,

I've been getting the following exception when trying to query ObjectDB in server mode version 2.3.4_05.

java.lang.ArrayIndexOutOfBoundsException: 36
        at com.objectdb.o.UTY.aH(UTY.java:1227)
        at com.objectdb.o.ENH.b(ENH.java:102)
        at com.objectdb.o.LDR.x(LDR.java:444)
        at com.objectdb.o.LDR.UU(LDR.java:669)
        at com.objectdb.o.CST.ab(CST.java:476)
        at com.objectdb.o.CST.U2(CST.java:412)
        at com.objectdb.o.LDR.w(LDR.java:382)
        at com.objectdb.o.LDR.v(LDR.java:293)
        at com.objectdb.o.OBC.aO(OBC.java:1077)
        at com.objectdb.o.QRR.b(QRR.java:208)
        at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:696)

After the first time this error shows up I can no longer query the database.

Any ideas why this would happen?

Thanks,

Eitan

#2

Just wanted to add some more information.

Just before the exception I get this in the log:

[ObjectDB 2.3.4_03] Unexpected exception (Error 990)
  Generated by OpenJDK 64-Bit Server VM 1.6.0_20 (on Linux 2.6.32-71.el6.x86_64).
Please report this error on http://www.objectdb.com/database/issue/new

 

And it seems like this exception starts to show up after the DB was modified and then all queries return errors.

Thanks,

Eitan

#3

The cause of this exception is unclear but according to the stack trace it is related to failed schema evolution.

The number 36 indicates type version number 36 (i.e. after 35 modification of some entity type). You have an object with that type version number but the type version doesn't exist in the database. The reason for this is unclear and it may indicate an unknown bug in ObjectDB.

If restarting the ObjectDB server doesn't help, try to use the ObjectDB Doctor, first to check the database and then to fix it. If it doesn't help - you may have to delete that specific entity object to make the database useful again. If you could submit the database file (possibly in a support ticket) it may help in understanding and fixing the problem.

ObjectDB Support
#4

Hi,

I have restarted objectdb server and immediately after a create, update or delete operation the DB throws these errors again. I tried to run the Doctor and it found some indices it needed to rebuild and after they were rebuilt using the doctor the same behavior was experienced.

 

I then tried to delete the DB and create it from scratch and am now getting a similar error:

[ObjectDB 2.3.4_05] Unexpected exception (Error 990)
  Generated by OpenJDK 64-Bit Server VM 1.6.0_20 (on Linux 2.6.32-71.el6.x86_64).
Please report this error on http://www.objectdb.com/database/issue/new
com.objectdb.o.InternalException: java.lang.ArrayIndexOutOfBoundsException: 4

java.lang.ArrayIndexOutOfBoundsException: 4
        at com.objectdb.o.UTY.aH(UTY.java:1227)
        at com.objectdb.o.ENH.b(ENH.java:102)
        at com.objectdb.o.LDR.x(LDR.java:444)
        at com.objectdb.o.LDR.UU(LDR.java:669)
        at com.objectdb.o.CST.ab(CST.java:476)
        at com.objectdb.o.CST.U2(CST.java:412)
        at com.objectdb.o.LDR.w(LDR.java:382)
        at com.objectdb.o.LDR.v(LDR.java:293)
        at com.objectdb.o.OBC.aO(OBC.java:1079)
        at com.objectdb.o.QRR.h(QRR.java:279)
        at com.objectdb.o.QRR.b(QRR.java:175)
        at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:696)

 

I'm afraid I can't share the database file at the moment.

Thanks,

Eitan

#5

What was the output of the Doctor? Are there any errors except indexes that have to rebuilt?

Type version #4 in a new database is unexpected, since you probably haven't changed the schema of the type already 3 times.

Is it possible that you have different versions of your classes in different clients? In that case - each client may send its own version of the entity class to the server, the version numbers are increased constantly, and one client may see an object with a version that it doesn't know yet. Please verify that your classes on all the clients are identical.

ObjectDB Support
#6

Here is the output from the Doctor:

ObjectDB Doctor [version 2.3.4_05]
Copyright (c) 2011, ObjectDB Software. All rights reserved.

Scanning the database file...
. 4MB (total)

Analyzing database structure...
10% 20% 30% 40% 50% 60% 70% 80% 90% 100%

Index Errors
------------
[1] Index com.contextspace.datamodel.attribute.AttributeValue[name] requires rebuild.
  - has 280 entries instead of 0
[2] Index com.contextspace.datamodel.config.RAConfig[raId] requires rebuild.
  - has 3 entries instead of 0
[3] Index com.contextspace.datamodel.messages.InternationalisedMessage[categories] requires rebuild.
  - has 14 entries instead of 0

 

I do have 3 different clients using the DB and they are supposed to be all using the same classes. I'll double check.

 

Thanks,

Eitan

#7

OK, the database looks healthy.

The index errors are probably the result of adding new indexes in entity classes that already have instances in the database (the numbers in the messages are replaced, it should be "has 0 entries instead of 280", and it will be fixed).

ObjectDB Support
#8

Thanks for the tip regarding the old version of the classes. I did have an older version somewhere which I thought didn't exist.

I've removed the old classes, recreated the DB and is back to normal working now.

Thanks

#9

Thank you for the update.

Currently an ObjectDB server supports live schema changes. The purpose was to handle schema changes without server restart, but the result is that two clients with different schema may cause an infinite update process.

This requires rethinking. Maybe class file timestamps have to be checked and only newer schema be accepted. Maybe schema changes should not be allowed without restarting the server.

ObjectDB Support

Reply