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:
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".
C++ client application:
Start your C++ application from a command prompt.
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.
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:
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
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).
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