Class loader issues in Kawa when using OrientDB

196 views Asked by At

I'm seeing some odd class loading issues when using Kawa 2.1 and OrientDB (community 2.1.10). My CLASSPATH only contains jars related to kawa and orientdb.

The following snippet:

(! g (com.tinkerpop.blueprints.impls.orient.OrientGraph "remote:localhost/GratefulDeadConcerts"))
(g:addVertex "class:Person" "name" "Jill" "age" 33)
(g:commit)

generates this exception:

com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing.
        at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:446)
        at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:398)
        at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:282)
        at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:170)
        at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2158)
        at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1381)
        at com.orientechnologies.orient.client.remote.OStorageRemoteThread.commit(OStorageRemoteThread.java:453)
        at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:593)
        at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:156)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2689)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2658)
        at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:161)
        at atInteractiveLevel-49.run(scratchpad.scm:54)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:293)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
        at kawa.Shell.run(Shell.java:291)
        at kawa.Shell.runFile(Shell.java:524)
        at kawa.standard.load.apply2(load.java:67)
        at kawa.standard.load.apply1(load.java:27)
        at gnu.mapping.Procedure.apply(Procedure.java:135)
        at gnu.mapping.Procedure.apply(Procedure.java:118)
        at gnu.mapping.CallContext.runUntilDone(CallContext.java:227)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:350)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
        at kawa.Shell.run(Shell.java:291)
        at kawa.Shell.run(Shell.java:203)
        at kawa.Shell.run(Shell.java:184)
        at kawa.repl.processArgs(repl.java:687)
        at kawa.repl.main(repl.java:793)
    Caused by: java.lang.RuntimeException: com.orientechnologies.orient.core.exception.ODatabaseException: Error on deserialization of Serializable
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.readSingleValue(ORecordSerializerBinaryV0.java:390)
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.deserialize(ORecordSerializerBinaryV0.java:195)
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:74)
        at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:1817)
        at com.orientechnologies.orient.server.tx.OTransactionOptimisticProxy.unmarshallRecord(OTransactionOptimisticProxy.java:284)
        at com.orientechnologies.orient.server.tx.OTransactionOptimisticProxy.begin(OTransactionOptimisticProxy.java:169)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.begin(ODatabaseDocumentTx.java:1703)
        at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.commit(ONetworkProtocolBinary.java:1222)
        at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:404)
        at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:223)
        at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
    Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on deserialization of Serializable
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.OSerializableWrapper.fromStream(OSerializableWrapper.java:47)
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.readSingleValue(ORecordSerializerBinaryV0.java:384)
        ... 10 more
    Caused by: java.lang.ClassNotFoundException: gnu.math.IntNum
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
        at com.orientechnologies.orient.core.serialization.serializer.record.binary.OSerializableWrapper.fromStream(OSerializableWrapper.java:44)
        ... 11 more

I believe gnu.math.IntNum is actually already included in Kawa and I can instantiate the said class in Kawa repl. Any idea what's going on here? Much obliged for any help/pointers!

1

There are 1 answers

0
wolf4ood On

Seems that you are inserting in a field gnu.math.IntNum that is not supported by OrientDB. You should convert this IntNum to Java type