Running the debugger from OLT

To debug business objects, servlets, or EJBs using Object Level Trace, complete the following steps. You should already have created a trace (by running OLT in "Trace only" mode) and set method breakpoints on the trace:

  1. The location of the debugger daemon determines where the debugger interface opens when OLT encounters your first method breakpoint. The debugger daemon automatically starts after the first client application executing in Debug only or Trace and debug execution mode is registered (assuming that you have not changed the Distributed debugger settings to point to another machine).

    If you intend to interact with the Debugger interface on this same workstation, you can continue on to step 2.

    If you prefer to interact with the debugger on the client workstation, or another remote machine, follow the instructions in the topic "Debugging from a remote workstation".

  2. Start OLT.
  3. Deselect Options > Step-by-step debug mode.
  4. Start your client application:

    C++ client application:
    Start your C++ application from a command prompt.

    ngwin.gif (1069 bytes)Alternatively, if the OLT server is running on your client machine, you can start the application from OLT by selecting File > Start process. The Start Process dialog box maintains a list of previously-run applications, making it easier to run your application a second time.

    Java client application:
    At a command prompt, enter this command:

    for Java 1.1.x:

    java_g -debug -nojit
    -Dcom.ibm.CORBA.requestTimeout=0
    -Dcom.ibm.CORBA.BootstrapHost=<BootstrapHostname>
    -Dcom.ibm.CORBA.EnableApplicationOLT=true
    -Dcom.ibm.CORBA.OLTApplicationHost=<OLT_Server_Host>
    -Dcom.ibm.CORBA.OLTApplicationPort=<OLT_Server_Port>
    -DOLTClient=true
    -classpath <path\YourAppJarFile>;<path\somojor.zip>;
    <path\dertrjrt.jar>;%CLASSPATH%
    yourapp

    for the Java 2 platform:

    java -Xdebug -Djava.compiler=NONE
    -Dcom.ibm.CORBA.requestTimeout=0
    -Dcom.ibm.CORBA.BootstrapHost=<BootstrapHostname>
    -Dcom.ibm.CORBA.EnableApplicationOLT=true
    -Dcom.ibm.CORBA.OLTApplicationHost=<OLT_Server_Host>
    -Dcom.ibm.CORBA.OLTApplicationPort=<OLT_Server_Port>
    -DOLTClient=true
    -Xbootclasspath:<path\YourAppJarFile>;<path\somojor.zip>;
    <path\dertrjrt.jar>;%JAVA_HOME%\lib\tools.jar;
    %JAVA_HOME%\jre\lib\rt.jar;%CLASSPATH%
    yourapp

    where:
    <BootstrapHostname> = your fully-qualified server application host name (only needed if System Manager is running on a different host)
    <OLT_Server_Host> = the fully-qualified name or TCP/IP address of the machine running your OLT server
    <OLT_Server_Port> = the port where the OLT server listens for connecting OLT clients
    <path\somojor.zip> = x:\CBroker\lib\somojor.zip on Windows NT; /usr/lpp/CBConnector/lib/somojor.zip on AIX; /opt/IBMdebug/lib/dertrjrt.jar on Solaris.
    <path\dertrjrt.jar>
    = x:\IBMDebug\lib\dertrjrt.jar on Windows NT; /usr/idebug/lib/dertrjrt.jar on AIX; /opt/IBMdebug/lib/dertrjrt.jar on Solaris.

  5. On the Client Controller page, select Trace and debug from the list of execution modes.
  6. If you want all subsequent client applications registering with OLT to use the same settings, check the Use default settings for all clients box.

    If you do not check this box, a dialog box opens when the next client application attempts to register with OLT. To use the same settings, click Run. To change the settings for the application, click Change settings and do the following on the Client Controller page:

    1. Select the client id that corresponds to the client application you started.
    2. In the Debugger hostname field, enter the host name for the workstation on which you started the debugger daemon. If you changed the default port number for the Debugger Daemon (8001), enter the new port number in the Debugger TCP/IP port field.
    3. Select Trace and debug from the execution mode list. 
    4. Click Apply to apply the monitoring mode change.
  7. Click Apply. The client application is now registered with OLT.
  8. Switch to the OLT View page to start viewing your trace.

As your application runs, trace lines and symbols are added to the OLT viewer. When OLT encounters a method breakpoint, the debugger automatically attaches to the process and finds the method on which you set the breakpoint. At the same time, the debugger interface opens on the workstation where the debugger daemon is running.

Once you have stepped through the object method call, servlet, or EJB, your application runs until the next method breakpoint, or the end of the program, is reached. Alternatively, you can step the debugger out of the server-side function and into your client code. This opens a second debugger pane, which points to the client code, immediately past the server call. Thus, you are able to debug both server and client seamlessly, as if they were one application.

While the debugger is open, it is in complete control of the application server. Any other OLT sessions tracing on the application server will be suspended. Also, new OLT sessions will not be able to connect to the application server.

Location of source code
Before starting your application server or servlet, set the DER_DBG_PATH environment variable on your server or client workstation. The debugger uses this environment variable to locate source files for your client application.

When debugging Java classes, make sure that any source files for your classes are accessible from the system CLASSPATH environment variable. That is, if the source for my.package.MyClass resides in x:\source\my\package\MyClass.java, you must add x:\source to the CLASSPATH. Otherwise, you will not be able to view the source.

On the AS/400, you must set add the -classpath option to the in the Command line arguments field on the General page of the WebSphere Application Server Administrative Console. For example if you want to debug the com.mycompany.mybeans.AccountBean class, and the debuggable version of the AccountBean class resides in directory /QIBM/UserData/WebASadv/enterprisebeans/com/mycompany/mybeans, specify -classpath /QIBM/UserData/WebASadv/enterprisebeans.

If your source and class files are in different locations, you must add -Ddebugsourcepath option to the Command line arguments field on the General page of the WebSphere Application Sever Administrative Console. For example, if your source for the com.mycompany.mybeans.AccountBean class resides in directory /QIBM/UserData/WebASadv/enterprisebeans/mysource/com/mycompany/mybeans, specify -Ddebugsourcepath /QIBM/UserData/WebASadv/enterprisebeans/mysource

ngwin.gif (1069 bytes)While debugging a C++ business object, do not close the debugger window. Doing so shuts down the application server (this is a Windows NT limitation only). When you finish debugging, stop your application server using System Manager, then close the OLT (which also closes the debugger windows).

ngrelc.gif (533 bytes)
Multi-programmer support
How to read the trace


Tracing a distributed application
Setting method breakpoints on the trace
Debugging from a remote workstation
Debugging client applications from startup


OLT troubleshooting