Skip Headers
Oracle® Communications Network Integrity Developer's Guide
Release 7.1

E23701-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

22 Debugging and Testing Cartridges

This chapter provides information about debugging and testing cartridges in Oracle Communications Network Integrity.

Starting the WebLogic Server in Test Mode

To debug a deployed Network Integrity cartridge, start the WebLogic Managed Server in debug mode (not the Admin Server).

Use the following procedure to start the WebLogic Managed Server in debug mode:

  1. Stop both the Admin Server and Managed Server if they are still running.

  2. Go to directory <WEBLOGIC_HOME>/user_projects/domains/<DOMAIN>/bin.

  3. Copy the existing startWebLogic.sh script to a new script file, startWebLogic_Debug.sh.

  4. Use a text editor to open startWebLogic_Debug.sh.

  5. After the line ${JAVA_HOME}/bin/java ${JAVA_VM} –version, add the following two lines:

    echo "Launching Java with debug port: 10171"
     
    JAVA_OPTIONS="-Xdebug -Djava.compiler=NONE -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=10171,suspend=n $JAVA_OPTIONS"
    

    The debug port does not have to be 10171 if the port specified is available.

  6. Save this change.

  7. Copy the existing startManagedWebLogic.sh script to a new script file, startManagedWebLogic_Debug.sh.

  8. Use a text editor to open startManagedWebLogic_Debug.sh.

  9. Find the two lines that are referring to startWebLogic.sh.

  10. Replace startWebLogic.sh with startWeblogic_Debug.sh. This change is to start the WebLogic Managed Server in debug mode by invoking the startWebLogic_Debug.sh script.

  11. Save this change.

  12. Start the Admin Server by running the usual start-up script, startWebLogic.sh.

  13. Start the Managed Server in debug mode by running the new script, startManagedWebLogic_Debug.sh.

Configuring Remote Debugger in Design Studio

The Managed Server is now in debug mode. The next step is to configure the debugger in Eclipse to start remote-debugging the Network Integrity cartridges.

  1. From the Design Studio main menu, select Run then Debug Configurations, then open the Debug Configurations dialog to switch Design Studio to the Java perspective.

  2. From the left panel, select Remote Java Application.

  3. Click New to create a remote Java application debug configuration.

  4. Enter a name for this new debug configuration.

  5. In the Connect tab, click the Browse.

  6. Select an available project that contains the cartridge that to debug.

  7. Ensure that the default setting for Connection Type is Standard (Socket Attach).

  8. Enter the host IP address where the Network Integrity system (WebLogic Managed Server) is running.

  9. Enter the debug port, which should match the debug port entered in "Starting the WebLogic Server in Test Mode".

  10. Keep the default settings for the rest of the tab.

  11. Click Apply to save this new remote Java application debug configuration.

Now the developer can start to debug the Network Integrity cartridge (which should be already deployed on the Network Integrity system) from Design Studio by picking up the debug configuration just created. There is no difference from debugging a normal local Java application in Eclipse. We can put a break point in the cartridge Java source and start debugging from there. Please refer to Eclipse on-line help contents, Java development user guide then Getting Started then Basic tutorial then Debugging your programs, on how to debug a Java program in Eclipse.