1
void fireQuery()
{
    String rows = "";
    engine = new ExecutionEngine( graphDB );
    Transaction tx = graphDB.beginTx();

    try
    {
        ExecutionResult result = engine.execute("START n = node(*) RETURN n");


        for ( Map<String, Object> row : result )  //THIS IS THE LINE WHERE ERROR IS OCCURING
        {
            for ( Entry<String, Object> column : row.entrySet() )
            {
                rows += column.getKey() + ": " + column.getValue() + "; ";
            }
            rows += "\n";
        }

        tx.success();
    }
    finally
    {
        tx.finish();
    }
}

I'm getting the following error messages

Exception in thread "main" java.lang.NullPointerException
at org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource.getHighestPossibleIdInUse(NioNeoDbPersistenceSource.java:111)
at org.neo4j.kernel.impl.core.NodeManager.getHighestPossibleIdInUse(NodeManager.java:983)
at org.neo4j.kernel.impl.core.NodeManager$1.<init>(NodeManager.java:354)
at org.neo4j.kernel.impl.core.NodeManager.getAllNodes(NodeManager.java:352)
at org.neo4j.tooling.GlobalGraphOperations$1.iterator(GlobalGraphOperations.java:66)
at org.neo4j.cypher.internal.spi.gdsimpl.GDSBackedQueryContext$$anon$1.all(GDSBackedQueryContext.scala:90)
at org.neo4j.cypher.internal.executionplan.builders.GraphGlobalStartBuilder$$anonfun$createStartPipe$1.apply(GraphGlobalStartBuilder.scala:50)
at org.neo4j.cypher.internal.executionplan.builders.GraphGlobalStartBuilder$$anonfun$createStartPipe$1.apply(GraphGlobalStartBuilder.scala:50)
at org.neo4j.cypher.internal.pipes.StartPipe$$anonfun$internalCreateResults$1.apply(StartPipe.scala:36)
at org.neo4j.cypher.internal.pipes.StartPipe$$anonfun$internalCreateResults$1.apply(StartPipe.scala:35)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply$mcZ$sp(ClosingIterator.scala:36)
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35)
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35)
at org.neo4j.cypher.internal.ClosingIterator.failIfThrows(ClosingIterator.scala:86)
at org.neo4j.cypher.internal.ClosingIterator.hasNext(ClosingIterator.scala:35)
at org.neo4j.cypher.PipeExecutionResult.hasNext(PipeExecutionResult.scala:157)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
at scala.collection.convert.Wrappers$IteratorWrapper.hasNext(Wrappers.scala:29)
at org.neo4j.cypher.PipeExecutionResult$$anon$1.hasNext(PipeExecutionResult.scala:73)
at Test.MAIN.fireQuery(MAIN.java:75)
at Test.MAIN.main(MAIN.java:60)

engine is declared outside the function in the class and is of type ExecutionEngine. graphDB is declared outside the class too and is of type GraphDatabaseService and gets referenced to an object before calling the function fireQuery

2
  • which Neo4j version are you using? Commented Sep 21, 2013 at 20:09
  • 1.9.2 Community version. Commented Sep 22, 2013 at 6:18

1 Answer 1

1

This smells like either a classpath issue or another thread might try to shut down the graphdb while iterating the result is still in progress. Please post the tail of graph.db/messages.log containing the most recent full startup output for further analysis (probably not inline, maybe on pastebin or some other tool).

Could you please run https://gist.github.com/sarmbruster/6658637 using groovy and see if the error persists? Of course change the path to your graphdb instance.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.