Debugging Own Java Transformations with the New Runtime

Discussion on developing CloverETL engine, transformation components etc.

slechtaj
Posts: 192
Joined: Wed Aug 15, 2012 8:18 am

Debugging Own Java Transformations with the New Runtime

Postby slechtaj » Thu Jan 15, 2015 3:42 pm

NOTE: This article describes debugging Java transformations. If you are looking for information about CTL debugging instead, read our blogpost here: http://blog.cloveretl.com/code-debugging-cloveretl-designer

Sometimes when you need to define your own Java trasformation you might find it useful to debug your code. This used to be an easy task before a new runtime was introduced (since 4.0 release), as all you had to do was to set your breakpoints and press F11. However, this is no longer enough in later versions.

The new runtime runs as a new Java process along with Designer - therefore in order to debug your Java transformation this process has to run in debug mode and then debugged using "Remote Java Application" debug configuration. The debug mode for the runtime is configured in the Designer in Window > Preferences > CLoverETL > ETL Runtime > VM parameters:

Code: Select all

-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4444

runtimeVMParameters.png
Runtime VM Parameters
runtimeVMParameters.png (28.91 KiB) Viewed 1591 times

Where address is any free IP port that is then used to define Remote Java Apllication (Run > Debug Configuration > Remote Java Application) debug configuration:
DebugConfiguration-RemoteJavaApplication.png
Debug Configuration - Remote Java Application
DebugConfiguration-RemoteJavaApplication.png (39.54 KiB) Viewed 1591 times

Now, you can add breakpoints into your Java code wherever you need them:
AddBreakpoint.png
Add a breakpoint
AddBreakpoint.png (122.84 KiB) Viewed 1587 times

As soon as you have set your breakpoints, you can run the graph that uses your custom Java transformation. You might be asked to switch to Debug perspective, where you can finally debug your transformation.
Jan Slechta
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com

How to speed up communication with CloverCARE support


cron