Debugging Java filters

To debug a Java filter, you run it in a Gallium Data instance, and debug that instance remotely.

To do so, you can download the sample project and unzip it. This project contains:


To run these sample filters in a debugger, edit the debug.sh script to use the proper path, and run it:

$ sh debug.sh 

[INFO] Scanning for projects...

[INFO] 

[INFO] --------------------< galliumdata:java-filter-test >--------------------

[INFO] Building java-filter-test 1

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-cli) @ java-filter-test ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 2 source files to /Users/jdoe/JavaFilterExample/target/classes

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  1.500 s

[INFO] Finished at: 2022-12-25T16:50:03-08:00

[INFO] ------------------------------------------------------------------------

[INFO] Scanning for projects...

[INFO] 

[INFO] --------------------< galliumdata:java-filter-test >--------------------

[INFO] Building java-filter-test 1

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] --- maven-jar-plugin:3.2.0:jar (default-cli) @ java-filter-test ---

[INFO] Building jar: /Users/jdoe/JavaFilterExample/target/java-filter-test-1.jar

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  0.622 s

[INFO] Finished at: 2022-12-25T16:50:05-08:00

[INFO] ------------------------------------------------------------------------

Listening for transport dt_socket at address: 8000


This script starts an instance of Gallium Data, but maps all the relevant files into the instance so that it will run your filter(s).

The JVM is now ready to be contacted by a debugger. In your IDE, start a remote debugging session and connect to localhost on port 8000. This will start Gallium Data, and you should see something like the following in your terminal:

[INFO     core Sys] 00:50:13.180 [main-1] - Gallium Data v.1.8.2 (build 1782) is now starting

[INFO     core Sys] 00:50:13.259 [main-1] - RESTManager: HttpServer has started on port 8080

[INFO     core Sys] 00:50:14.998 [main-1] - RESTManager: HttpsServer has started on port 8043

[INFO     core Sys] 00:50:15.688 [main-1] - Gallium Data is now running

You can now connect to the Gallium Data UI at http://localhost:8086/web/index.html and create a project, a database connection, and of course instances of your Java filters -- they will show up in the list of available filters.

You can set breakpoints in your Java filters' code, and they will be hit when a database client activates them.