Ubik Batch Server Remote Debugging

From UbikWiki

Contents

Remote Debugging

What is it

Remote debugging enables simple debugging of Batches from inside Eclipse Environment.

It ensures you test your batches in a real Batch Server environment. It's the most accurate way to test your batches.

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)

  • 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)

Start Server in Debug (ONCE per Debug session) and connect with JMX

  • 1) Start Batch Server using:
    • Edit <INSTALL_FOLDER>/bin/console.bat
  • 2) This line will appear in shell:
    • Listening for transport dt_socket at address: 5006
  • 3) Connect to Batch Server using JConsole:
    • Click on <JDK_HOME>\bin\jconsole.exe
Image:UBS_jconsole.png
    • Enter in remote field, the URL that is contained in file:
      • <INSTALL_FOLDER>/config/jmx-service-url.txt
      • Example:
        • service:jmx:rmi://GIHQD134:5002/jndi/rmi://GIHQD134:5001/UBS600
    • Enter:
      • username : dev
      • password : dev


Setup Eclipse Launcher (ONCE per Batch project)

In Eclipse Select Debug>Debug Configurations:

Image:Eclipse_rdebug_01.png

Fill in:

  • Project (your BAR project)
  • Host : localhost
  • Port : The port you configured in Batch Server in JAVA_OPTS, 5006 in our example:
Image:Eclipse_rdebug_02.png

Start your batch

  • 1) In JConsole, select "MBeans" tab:
Image:UBS_MBeans.png
  • 2) 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
  • 3)Unfold "Operations" node
  • 4)Select start node
  • 5)Click on start button
Image:UBS_MBeans_02.png

That's it

Now here is what you get:

  • You can put DEBUGGING points in your project code to debug your batch
Personal tools