HI, I was new to procedures and was trying to debug the procedures that i’ve wrote. can someone suggest on how to do that.?

HI, I was new to procedures and was trying to debug the procedures that i’ve wrote. can someone suggest on how to do that.?

Usually you write a unit or integration test that uses the procedure, and then if the test fails, you can set break-points in your IDE and debug the code.

The procedure example repository helps you to get set-up:

And the manual walks through writing and testing procedures, see the about message on top of the #neo4j-graph-platform:procedures-apoc category.

1 Like

Thanks a ton micheal for the prompt reply. This community is awesome. Used the above example, enabled debug listener using Chapter 3. Setup for remote debugging - The Neo4j Java Developer Reference v3.4 and I was able debug with breakpoint in my procedure.

In order to configure the Neo4j server for remote debugging sessions, the Java debugging parameters need to be passed to the Java process through the configuration. They live in the conf/neo4j.conf file.

In order to specify the parameters, add a line for the additional Java arguments like this:

dbms.jvm.additional=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

This configuration will start a Neo4j server ready for remote debugging attachement at localhost and port 5005 . Use these parameters to attach to the process from Eclipse, IntelliJ or your remote debugger of choice after starting the server.

Yes that's useful for determining issues with existing setups / datasets.

In general I still suggest to debug / fix issues using unit tests.

The Neo4j Procedure Compiler may be useful here too, at least to catch the early kinds of errors at compilation.

2 Likes