ahoffer
ahoffer

Reputation: 6546

Simple cypher query on embedded graph DB from Java results in nullpointerexception

Until now I have only interacted with neo4j through its browser and REST interface. Now I want to interact with neo4j via Java and an embedded database.

I get a null pointer exception when I attempt to run a Cypher query. The console output did not help me:

Exception in thread "main" java.lang.NullPointerException
    at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58)
    at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:54)
    at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:65)
    at neo.project1.App.main(App.java:59)

Upvotes: 0

Views: 225

Answers (1)

BtySgtMajor
BtySgtMajor

Reputation: 1462

Try this:

ExecutionEngine engine = new ExecutionEngine(graphDb);

Sounds like your original constructor call (with the second parameter as NULL) is letting the ExecutionEngine try to use a NULL logger.

Upvotes: 3

Related Questions