0

我已将 Neo4j 从 2.3.8 升级到 3.3.1。访问hits = index.query(query); 我得到 nullPointerException。下面是我的代码。

protected Record getNext() throws Exception {          
Transaction tx=neo.beginTx();
try {
    if (hits == null) {
        if (query!=null) {
        hits = index.query(query);
      tx.success();       
    } 
    }
    T next = hits.next();
    if (next == null) {
        return finished();
    } else {
        return nodeToRecord.call(next);
    }
}

您可以检查上面的代码我正在检查查询!= null,但仍然得到空指针。是索引的问题吗?

下面是错误

 Unexpected error : java.lang.NullPointerException
    at au.com.graph.NodeIterator.getNext(GraphNodeIterator.java:64)
    at au.com.graph.NodeIterator.getNext.getNext(GraphNodeIterator.java:22)
    at com.googlecode.totallylazy.iterators.StatefulIterator.hasNext(StatefulIterator.java:23)
    at com.googlecode.totallylazy.iterators.StatefulIterator.next(StatefulIterator.java:36)
    at com.googlecode.totallylazy.Computation$2.call(Computation.java:80)
    at com.googlecode.totallylazy.callables.LazyCallable.get(LazyCallable.java:19)
    at com.googlecode.totallylazy.Lazy.call(Lazy.java:22)
    at com.googlecode.totallylazy.Computation.isEmpty(Computation.java:121)
4

0 回答 0