Java client debugging

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 sets of arguments to start the Java client application:

where:

Remote debugging
On the machine where you want to run the debugger user interface, start the debugger daemon with this command:

idebug -qdaemon -quiport=<ui_daemon_port>  -qlang=java

for Java 1.1.x:

irmtdbgj -qhost=<Hostname> -quiport=<ui_daemon_port>
-qjvmargs="
-nojit
-Dcom.ibm.CORBA.EnableApplicationOLT=true
-Dcom.ibm.CORBA.requestTimeout=0
-Dcom.ibm.CORBA.BootstrapHost=<BootstrapHostname>
-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:

irmtdbgj -qhost=<Hostname> -quiport=<ui_daemon_port>
-qjvmargs="
-Djava.compiler=NONE
-Dcom.ibm.CORBA.EnableApplicationOLT=true
-Dcom.ibm.CORBA.requestTimeout=0
-Dcom.ibm.CORBA.BootstrapHost=<BootstrapHostname>
-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:
<Hostname> is the host name of the machine where the Debugger Daemon is running

<ui_daemon_port> is the TCP/IP port number for the debugger daemon, if not 8001. This parameter is optional, and can be used when port 8001 is busy.

<BootstrapHostname> is your fully-qualified server application host name (only needed if System Manager is running on a different host)

<OLT_Server_Host> is  the fully-qualified name or TCP/IP address of the machine running your OLT server

<OLT_Server_Port> is  the port where the OLT server listens for connecting OLT clients

<path\somojor.zip> is only required when debugging a Component Broker client. It should be set as follows:  /usr/lpp/CBConnector/lib/somojor.zip on AIX, /opt/CBConnector/lib/somojor.zip on Solaris, and  x:\CBroker\lib\somojor.zip on Windows.

<path\dertrjrt.jar> is  /usr/idebug/lib/dertrjrt.jar on AIX,  opt/IBMdebug/lib/dertrjrt.jar on Solaris, and  x:\IBMDebug\lib\dertrjrt.jar on Windows.

yourapp is the fully qualified path to your program. For example,  C:\MyApps\MyApp.exe on Windows or /usr/me/myapps/myapp on AIX or Solaris 

 

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 BO calling another Java BO 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 the following string before the application name: -mx75m -ms30m -oss75m. For example:

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
-mx75m -ms30m -oss75m
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
-Xmx75m -Xms30m -Xoss75m
yourapp

If the out-of-memory error reoccurs, increase the -mx value.