我试图在Orient Db 3.0.0-M2上构建一些实时查询。 但是当我尝试执行查询时,它会给出一个Null指针异常。我在东方服务器中启用了精细日志级别,并在服务器中找到了以下行。
Sent run-time exception to the client /192.168.1.102:63830: java.lang.NullPointerException [ONetworkProtocolBinary]
我用来查询的代码是:
int monitorId = db.live("LIVE SELECT FROM Mark", new MyOLiveQueryResultListener()).getMonitorId;
在Java客户端上,我得到以下异常(我猜是错误的服务器端对应 - 如果我错了,请纠正我。)
Exception in thread "Thread-5" com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:339)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:280)
at com.orientechnologies.orient.client.remote.OStorageRemotePushThread.run(OStorageRemotePushThread.java:50)
Caused by: java.lang.NullPointerException
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.copy(ODatabaseDocumentEmbedded.java:305)
at com.orientechnologies.orient.core.sql.executor.LiveQueryListenerImpl$1.call(LiveQueryListenerImpl.java:68)
at com.orientechnologies.orient.core.sql.executor.LiveQueryListenerImpl.execInSeparateDatabase(LiveQueryListenerImpl.java:202)
at com.orientechnologies.orient.core.sql.executor.LiveQueryListenerImpl.<init>(LiveQueryListenerImpl.java:65)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.live(ODatabaseDocumentEmbedded.java:501)
at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeSubscribeLiveQuery(OConnectionBinaryExecutor.java:1310)
at com.orientechnologies.orient.client.remote.message.OSubscribeLiveQueryRequest.execute(OSubscribeLiveQueryRequest.java:77)
at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeSubscribe(OConnectionBinaryExecutor.java:1283)
at com.orientechnologies.orient.client.remote.message.OSubscribeRequest.execute(OSubscribeRequest.java:68)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:274)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:180)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
我也尝试使用Orient DB 2.2.x文档中显示的方式执行此操作,但我得到了相同的错误,并且不推荐调用db.query(OLiveQuery)。