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();
}
}
次のエラー メッセージが表示されます
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
はクラス内の関数の外側で宣言され、タイプはExecutionEngine
です。
graphDB
クラス外でも宣言され、型GraphDatabaseService
であり、関数を呼び出す前にオブジェクトに参照されますfireQuery