Debugging a Java client

To include debug information, compile Java code with javac -g command for Java 1.1.x. For the Java 2 platform use the javac -g:lines,vars,source command.

Local debugging

After starting OLT, use one of the following commands to start the Java client application:

java
-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
AppName

where:

Use the command appropriate for the level of the JDK of the client application.

Use the command appropriate for the level of the JDK of the client application.

Remote debugging

Start OLT. On the machine where you want to run the Debugger user interface, start the Debugger daemon with the following command:

idebug -qdaemon -quiport=<ui_daemon_port>

On the machine where the client of your debuggee application is supposed to run, issue the command that starts the Debugger engine. This command must be appropriate for the level of the JDK of the client application.

Tracing VisualAge Java clients or tracing Java business objects through the Java orb

To trace VisualAge Java clients outside of a WebSphere or Component Broker environment, set the following OLT properties inside the code. You also need to set these properties if you want to trace a Java business object calling another Java business object through the Java orb (as opposed to the C++ orb):

java.util.Properties props = new java.util.Properties();
props.put("com.ibm.CORBA.requestTimeout","0");
props.put("OLTClient","true");
props.put("com.ibm.CORBA.EnableApplicationOLT","true");
props.put("com.ibm.CORBA.OLTApplicationHost","<OLT_Server_Host>");
props.put("com.ibm.CORBA.OLTApplicationPort","<OLT_Server_Port>");
props.put("com.ibm.CORBA.BootstrapHost","<BootstrapHostname>");

System.out.println("1) About to call ORB.init passing Bootstrap information passed in on command line");
orb = ORB.init (args, props);

Add the file dertrjrt.jar to your classpath.

If you are using the VisualAge Java IDE debugger, you can trace and debug with OLT, but please note the following limitations:

Out-of-memory errors when starting a Java client application

If you encounter memory errors when starting a Java client application, modify the start command to include memory management options that specify settings pertaining to the JVM of the client application. Add the string -mx75m -ms30m -oss75m to the Java command arguments, immediately preceding the name of your application.

If the out-of-memory errors reoccur, try increasing the -mx value.


OLT troubleshooting
Java commands for tracing and debugging