How to Debug Apache ODE with Apache Tomcat Server

  • Ishara Premadasa
  • Solutions Engineer - WSO2
  • 21 Sep, 2011


Apache ODE (Orchestration Director Engine) can be deployed and run in three different environments. One of those three methods is deploying ODE as a web service in Axis 2, by deploying the ode war distribution(ode.war) inside an application server like Apache tomcat.
Once it is deployed and started you may need to debug ODE, to understand what is going inside the engine. The following is a short guide on how to debug
Apache ODE in tomcat with both Windows and Linux environments using the IntelliJ Idea as the standard IDE.

Applies To:

Apache ODE 1.3.5
Apache Tomcat 7.0.11
IntelliJ Idea 10.0.3


Debug ODE in Ubuntu 10.04

Deploying and Running Apache ODE using Tomcat Server

If you haven't downloaded Apache Tomcat and Apache ODE download them by clicking on them and visiting the corresponding web page. After downloading them extract
the archives into your local hard drive.Copy the ode.war distribution which is found inside the extracted ode_1.3.5 directory into the apache_tomcat_7/webapps directory. Once the tomcat server started back, ODE will be deployed in the tomcat server.

Start tomcat in console by using,

apache-tomcat-7/bin$ sh startup.sh

Now go to https://localhost:8080/ode in your browser and ODE home page will appear as shown in Figure 1.

Figure 1: Apache ODE home page

Debugging ODE in Tomcat

Apache Tomcat can be debugged with JPDA debugger by starting tomcat with catalina script. To do this
go to Tomcat_Home/bin folder and enter the following command.

apache-tomcat-7/bin$ sh catalina.sh jpda run  

This will start catalina server in debug mode and you can see it displays the
message, "Listening for transport dt_socket at address: 8000" in terminal as shown in Figure 2.

Figure 2: Starting tomcat in debug mode

Another method would be setting the JAVA_OPTS to start up java for listening to debugger connections by giving,

apache-tomcat-7/bin$  export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"

When it is set, start the catalina server in the usual manner as 'sh catalina.sh run' and tomcat will be started in debug mode.

Now we can create a remote debug configuration by giving Host: localhost and Port: 8000 in our IDE which is used to open the ode source code, and debug ODE by using that. Remember to use the same port used as
JPDA_ADDRESS in tomcat as your IDE's remote debug port. The default port address is 8000.

Creating a Remote Debug Configuration in Idea 10.0.3

This is how to create a remote debug with IntelliJ Idea 10.

  1. Go to Run --> Edit Configurations in the IDE
  2. Figure 3: Creating a remote debug configuration

  3. When it is selected the Run/Debug Configurations window will pop up. Click the icon there and
    select 'Remote' from 'Add New configuration' menu.
  4. Figure 4: Created new remote debug

  5. This will create a new remote debug configuration for us. Let's name it as 'ode' and fill the Host field with 'localhost' and Port
    field with '8000'. Then click OK.
  6. Figure 5: Setting up Host and Port for remote debugging

  7. The new remote debug is successfully created now. After the tomcat server is started, select 'ode' remote debug and start it by clicking icon in Idea. It will
    connect to the server via the defined port and you can start debug ODE now.
  8. Figure 6: Debugging ODE

    Note: port 8000 is the default port address used in tomcat for JPDA debugging, however if port 8000 is busy (due to some other application running
    there), you can change it into another port. If it is needed follow the given steps.

  9. Open catalina.sh script in the Tomcat_Home/bin folder and search for JPDA_ADDRESS, you will see JPDA_ADDRESS="8000" defined there. Change it to any available port and restart tomcat under JPDA debugger. The
    server will listen from the new address now.
  10. Figure 7: Edit the JPDA_PORT in catalina script

    You can also change this port (let's say to 8010) by giving following command in terminal.

    apache-tomcat-7/bin$ export JPDA_ADDRESS=8010 
  11. Now go back to the 'ode' remote debug and select 'Edit Configurations' to edit its configurations.
  12. Figure 8: Edit the remote debug configuration in Idea 10.0.3

  13. When Debug Configuration window appears set the Port address into the modified port, 8010. Once it is set ODE can be debugged using the new port again.

Debug ODE in Windows

Debugging in Windows is also very similar to in Linux, except the commands that should be used. All the following
demonstrations are performed in Windows 7 version.

  • To start tomcat, go to the tomcat home's bin folder and start catalina.bat file under jpda debugger as follows.
  • C:\Apache-Tomcat-7\bin> catalina.bat jpda run 

    Now catalina will start in remote debugging mode under JPDA debugger using its default port 8000. When it is started you will see tomcat starts a new debug
    console as shown below in Figure 9.

    Figure 9: Tomcat debugger console in Windows 7

    This can be also done by setting an environment variable JAVA_OPTS, and starting the tomcat server with usual command.


    C:\ Apache-Tomcat-7\bin> set JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"

    C:\Apache-Tomcat-7\bin> catalina.bat run

    When it is started create a new remote debug configuration as described in the previous section by configuring the correct Port address and Host. Once the remote debug configuration is
    connected to the server, you can debug ODE successfully.

    Note: To change the port address from 8000 to another port 'set' command can be used in Windows. Go to Apache-Tomcat-7\bin and enter;

    C:\ Apache-Tomcat-7\bin> set JPDA_ADDRESS="8010"

    Figure 10: Change JPDA_ADDRESS in tomcat

    When tomcat is started again you will see that it has changed the listening port into '8010' as we changed. Change the Port address in the
    remote debug into this new address and start debugging again.

    Figure 11: Debugging tomcat in Different Port

    JPDA_ADDRESS can be also changed from the catalina.bat file in Windows. Right click catalina.bat file and select 'Edit' option from the menu.
    Then the file will be opened using Notepad or some other text document opening application in Windows. Search for JPDA_ADDRESS and change its value
    into a new one. Save the file back and start tomcat again.


Ishara Premadasa

Undergraduate, Dept. of Computer Science and Engineering

University of Moratuwa

[email protected]


About Author

  • Ishara Premadasa
  • Solutions Engineer
  • WSO2