0

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)

1 Answer 1

3

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.

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

1 Comment

Thanks. That lead to a stack trace that was useful. It turns out the ExecutionResult.dumpToString must be inside of a transaction. It now works.

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.