Ubik Batch Server Remote Debugging
From UbikWiki
(Difference between revisions)
(→Setup Batch Server (Done only ONCE)) |
(→Setup Batch Server (Done only ONCE)) |
||
Line 14: |
Line 14: | ||
* Debug | * Debug | ||
- | == Setup Batch Server (Done only ONCE)== | + | == Setup Batch Server (Done only ONCE per developer Machine)== |
* 1) Run Batch Server Installer, see [[Ubik_Batch_Server_Installation_Guide|Server Installation Guide]] | * 1) Run Batch Server Installer, see [[Ubik_Batch_Server_Installation_Guide|Server Installation Guide]] | ||
Revision as of 15:55, 18 September 2012
Contents |
Remote Debugging
What is it
Remote debugging enables simple debugging of Batches from inside Eclipse Environment.
You will typically:
- Generate your BAR with maven:
- mvn clean install
- Copy the BAR to <BATCH_SERVER>/batches-cold-deploy folder
- Start the Batch Server with socket debug
- Configure your Eclipse to Remote Debug one BAR project
- Start The batch with JConsole
- Debug
Setup Batch Server (Done only ONCE per developer Machine)
- 1) Run Batch Server Installer, see Server Installation Guide
- 2) Add DEBUGGING options to Batch Server command line:
- Edit <INSTALL_FOLDER>/bin/setenv.bat
- Find JAVA_OPTS
- Add at end :
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006
- In this example, we put 5006 as debug port (ensure this port is not used)
Setup Eclipse Launcher (ONCE per Batch project)
In Eclipse Select Debug>Debug Configurations:
Fill in:
- Project (your BAR project)
- Host : localhost
- Port : The port you configured in Batch Server in JAVA_OPTS, 5006 in our example:
Start your batch
In JConsole, select "MBeans" tab:
And unfold node hierarchy:
- <BATCH_GROUP>/batch/runtime/<BATCH_NAME> for a classical Batch
- <BATCH_GROUP>/batch/runtime/<BATCH_NAME>__@@__<LAUNCH_NAME> for a Batch with launch
Unfold "Operations" node and click on start
That's it
Now here is what you get:
- You can put DEBUGGING points in your project code to debug your batch