简体   繁体   English

使用二进制协议序列化记录时,OrientDB服务器端NullPointerException

[英]OrientDB serverside NullPointerException while serializing record using binary protocol

I've just started to implement binary protocol API to orientDB with C++. 我刚刚开始使用C ++对orientDB实现二进制协议API。 Current Version of used orientDB is "orientdb-community-2.2.29" with win 10 x64 and java 1.8. 使用的orientDB的当前版本是“ orientdb-community-2.2.29”,带有Win 10 x64和Java 1.8。 Since I've tried to query "select * from XXXX" on example DB serverside exceptions are thrown and no record is serialized to client. 由于我已尝试在示例数据库服务器上查询“从XXXX选择*”,因此抛出了服务器端异常,并且没有记录序列化到客户端。 Here are the logs after successful connection and query: 以下是成功连接和查询后的日志:

2017-12-03 14:14:12:561 INFO  {db=Site} /0:0:0:0:0:0:0:1:2520 - Writing bytes (4+0=4 bytes): null [OChannelBinaryServer]$ANSI{green {db=Site}} Error on unmarshalling record #73:0 (java.lang.NullPointerException)
java.lang.NullPointerException
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.getRecordBytes(ONetworkProtocolBinary.java:2894)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.writeRecord(ONetworkProtocolBinary.java:2907)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.writeIdentifiable(ONetworkProtocolBinary.java:2697)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.serializeValue(ONetworkProtocolBinary.java:1639)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1584)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:660)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:394)
    at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:217)
    at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:81)

2017-12-03 14:14:12:561 WARNI {db=Site} Cannot serialize record: XXXX#73:0{Name:[2],IDs:[1]} v3 [ONetworkProtocolBinary]

Before writing the "null" bytes the recordID, position and record version is serialized and received on client side correctly, also querying from Studio or console works like a charm. 在写入“空”字节之前,recordID,位置和记录版本已正确序列化并在客户端正确接收,而且从Studio或控制台进行查询的过程也很吸引人。 I've tried to change the class - property to STRING or EMBEDDEDMAP with the same problem. 我试图将类-属性更改为STRING或EMBEDDEDMAP,但存在相同的问题。

Thanks in advance for help :-) 在此先感谢您的帮助:-)

Fortunately I found the mistake at my own: wrong SerializationImpl was configured. 幸运的是,我自己发现了错误:配置了错误的SerializationImpl。 The correct configuration must be ORecordSerializerBinary and not ONetworkProtocolBinary. 正确的配置必须是ORecordSerializerBinary,而不是ONetworkProtocolBinary。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM