Component Broker Object Level Trace examples

Object Level Trace (OLT) is an extension of the IBM Distributed Debugger that enables you to trace and debug multilingual, distributed applications from a single workstation.

The following scenarios use the Policy sample to illustrate some common OLT tasks for Component Broker applications:

The OLT samples in this section use the Policy sample application that is shipped with the product. You may need to reference the Policy sample's documentation (policy.html, policyc++.html, and javaclient.html) that is in the sample directory, as follows:

The following information applies to Windows.Preparing to use OLT on Windows NT/2000
To use these sample scenarios for Windows NT/2000, ensure that you have the Component Broker run time, C++ Client SDK, Java Client SDK, Server SDK, CBToolkit, and toolkit samples installed on your system. The samples have both C++ and Java clients and Business Objects. A C++ client will interact with a C++ and a Java Business Object and, similarly for the Java client. Complete these steps to get ready to run these samples:

  1. Generate code.
    From a command prompt, change to your working directory and generate code for debugging, as follows:
    cd x:\CBroker\samples\InstallVerification\ProgrammingModel
    obgen -pBusinessObjects\Policy -aAll -OIVB_TRACE_DEBUG
  2. Build server business objects.
    To build the C++ and Java Policy server application, change to generated code's directory and run nmake, as follows:
    cd x:\CBroker\samples\InstallVerification\ProgrammingModel
    cd BusinessObjects\Policy\Working\NT\TRACE_DEBUG
    nmake -f all.mak all
  3. Build C++ client application.
    To build the C++ client application, follow the instructions in policyc++.html. Make sure that you are copying files from the TRACE_DEBUG subdirectory and not the PRODUCTION subdirectory. Note that you will need to compile/link with these debug options:

    /Ti+ when compiling

    /DEBUG when linking

    For example, modify PolicyApp.mak as follows:

    .
    .
    .
    .\PolicyApp.obj: \ 
      .\PolicyApp.cpp 
      @echo " Compile " 
      icc.exe /Fo".\%|fF.obj" /Ti+ /I $(POLICYINCLUDEDIR) /C .\PolicyApp.cpp
    
    .\PolicyApp.exe: \ 
       .\PolicyApp.obj 
       @echo " Link " 
       icc.exe @<<
        /B" /de /DEBUG" 
        /FePolicyApp.exe 
        .\PolicyApp.obj 
        $(POLICYLIBDIR)\PolicyC.lib
    .
    .
    .
  4. Build Java client application.
    To build the Java client application, edit the makefile for PolicyApp client to change the POLICY_DIR setting so that "PRODUCTION" is replaced by "TRACE_DEBUG". Then to build the Java client application, follow the instructions in javaclient.html. Also, when compiling, add the -g option before -classpath in the javac command. Depending on the Java version, use the -g option as follows:

    Java applications:

    javac -g

  5. Install application.
    Follow the instructions in Install the Policy application using System Manager.

The following information applies to AIX.Preparing to use OLT on AIX
To use these sample scenarios for AIX, ensure that you have the Component Broker run time, C++ client SDK, Server SDK, CBToolkit, and toolkit samples installed on your system. The AIX OLT sample works with a C++ client and a C++ business object running on a single AIX system. Complete these steps to get ready to run the sample:

  1. Set up .profile.
    Before using OLT for Component Broker on AIX, be sure to add the following to your .profile:

    If you did a full Component Broker install:

    # Start the OLT login profile
    if [ -f /usr/idebug/bin/OLT.profile ]; then
    . /usr/idebug/bin/OLT.profile
    fi

  2. Generate code.
    Generate code for debugging and tracing, as follows:

    From a command prompt, copy samples to your working directory /home/cbuser/samples, and run obgen:

    cd /home/cbuser/samples/InstallVerification/ProgrammingModel
    obgen -pBusinessObjects/Policy -aAll -OIVB_TRACE_DEBUG
  3. Build C++ business objects.
    Change to generated code's directory and build the C++ server application:
    cd /home/cbuser/samples/InstallVerification/ProgrammingModel
    cd BusinessObjects/Policy/Working/AIX/TRACE_DEBUG
    make -f all.mak
  4. Build C++ client application.
    To build the C++ client application, follow the instructions in policyc++.html. When copying files, make sure that you are copying the files from the TRACE_DEBUG subdirectory and not the PRODUCTION subdirectory. Note that you will need to compile with the -g debug option. For example, you can modify the PolicyApp.mak file to add the -g option in the following line:
    .cpp.o:
        $(CCC) -g -c -o$@ $(CC_FLAGS) $<
  5. Install application.
    Follow the instructions in Install the Policy application using System Manager.

The following information applies to Solaris.Preparing to use OLT on Solaris
To use these sample scenarios for Solaris, ensure that you have the Component Broker run time and C++ Client SDK, Server SDK, installed on your Solaris system. You will also use CBToolkit and toolkit samples from a Windows NT/2000 system to generate the code for the Solaris system. The Solaris OLT sample works with a C++ client and a C++ business object running on a single Solaris system and the OLT server, viewer, client controller and debugger user interface are running on a Windows NT/2000 system. Complete the following steps to prepare to run the OLT sample on your Solaris system:

  1. Set up .profile.
    Before using OLT for Component Broker on Solaris, be sure to add the following to your .profile:

    If you did a full Component Broker install:

    # Start the OLT login profile
    if [ -f /opt/WebSphere/AppServer/bin/OLT.profile ]; then
    . /opt/WebSphere/AppServer/bin/OLT.profile
    fi

    If you installed only the SDK:

    # Start the OLT SDK login profile
    if [ -f /opt/WebSphere/AppServer/bin/OLT_SDK.profile ]; then
    . /opt/WebSphere/AppServer/bin/OLT_SDK.profile
    fi
  2. Generate code on Windows NT/2000 system.
    Generate code for debugging and tracing on a Windows NT/2000 system, as follows:

    The following information applies to Windows.From a command prompt on a Windows NT/2000 system, change to your working directory and generate code for debugging, as follows:

    cd x:\CBroker\samples\InstallVerification\ProgrammingModel
    obgen -pBusinessObjects\Policy -aAll -tSolaris -OIVB_TRACE_DEBUG

    The code will be generated into a Solaris subdirectory.

  3. Copy generated code to the Solaris system.
    Copy the generated code from the following directories on the Windows NT/2000 system:

    to the Solaris system in the following corresponding subdirectories:

  4. Build C++ business objects.
    Build the C++ server application:
    cd /home/cbuser/samples/Policy/Working/Solaris
    make -f all.mak
  5. Build C++ client application.
    To build the C++ client application, follow the build instructions in policyc++.html. Note that you will need edit the PolicyApp.mak file to compile with the -g debug option.
  6. Install application.
    Follow the instructions in Install the Policy application using System Manager.

The following information applies to OS/390.Preparing to use OLT Samples on OS/390
To use these sample scenarios for OS/390, ensure that you have the Component Broker run time and C++ Client SDK, Server SDK, installed on your OS/390 system. You will also need to use CBToolkit and toolkit samples from either a Windows NT/2000 or AIX system to generate the code for the OS/390 system. The OS/390 OLT sample works with a C++ client and a C++ business object running on a single OS/390 system and the OLT server and viewer monitors the events on an AIX system. Complete the steps described in Tracing and debugging a C++ client and business object on OS/390 to prepare and run the OS/390 OLT sample.

Install the sample application
After successfully building the Policy sample, run the System Manager user interface to install the application by following these steps:

  1. Create server.
    Create a Server Group and Server in the Sample Configuration using the System Manager wizards, as follows:
    1. Select Wizards > Create servers.
    2. Click Next to accept the defaults on the first two pages.
    3. On the Server group page, type a server group name. For this exercise, use myservergroup.
    4. Click Next.
    5. On the Server page, type a server name. For this exercise, use myserver.
    6. Click Finish.
  2. Load application.
    Define the sample application to System Manager. Load the application definition on your Host Image as follows:
    1. In System Manager, select View > View level > Control.
    2. Expand Host images.
    3. Select a host image. There is a default image that corresponds to the name of the system on which the Server with System Manager configuration was installed.
    4. Open the pop-up menu, and select Load application.
    5. Browse and select PolicyFamily.ddl when running the C++ business object samples. If you are running the sample for the Java business object, select JPolicyFamily.ddl. Make sure that you are selecting the ddl from the TRACE_DEBUG subdirectory.
    6. Click OK. The Action Console window indicates when the application has been successfully loaded.
    7. Close the Action Console window.
  3. Configure application server.
    Configure the application server using System Manager wizards, as follows:
    1. Select Wizards > Configure server.
    2. On the Select applications to configure page, select Policy, JPolicy, and idb2IMServices then click Add. (JPolicy, and idb2IMServices are required for the Java business object sample.)
    3. In the Management Zone page, Select Sample Application Zone.
    4. Click Next to accept the defaults on the next page.
    5. On the Select server to configure applications on page, select myservergroup, then click Add.
    6. Click Finish.
  4. Enable remote tracing and debugging.
    To enable remote tracing and debugging, follow these steps:
    1. Expand Host Images folder and expand the host image that corresponds to the name of your server.
    2. Select myservergroup. From its pop-up menu, select Properties. A notebook opens.
    3. Select the Main tab.
    4. Check the Enable debug box.
    5. The following information applies to AIX.The following information applies to Solaris.For AIX and Solaris servers only, do the following:
      1. Open the Host images folder and expand the host image that corresponds to the name of your server. From the pop-up menu, select Properties. A notebook opens.
      2. Select the Main tab
      3. Change the Health monitor polling interval value to 0 (or a value that cannot be easily reached when using the debugger, such as 300 seconds).
      4. Click OK to close the host image notebook.
    6. Select the ORB tab.
    7. Change the Request timeout value to 0 (or a value that cannot easily be reached when using the debugger, such as 300 seconds).
    8. Click OK to close the server image notebook.
    9. For all the sample scenarios, the client application resides on the same host as the application server. Follow these steps to enable debugging for the client:
      1. Expand Host Images > Client Style Images and select the host name that corresponds to the machine where your client application resides.
      2. From the client style image's pop-up menu, select Properties. A notebook opens.
      3. On the Main tab, check the Enable debug box.
      4. Enter the fully qualified name or TCP/IP address of the machine running your OLT server in the OLT hostname field. For the Solaris sample, make sure that you have the Windows NT/2000 machine identified in this OLT hostname entry.
      5. Enter the port where the OLT server listens for connecting OLT clients in the OLT port field. Unless 2102 is being used, you can leave this setting as it is and skip step j.
      6. Select the ORB tab.
      7. Change the request timeout value to 0 (or a value that cannot be easily reached when using the debugger, such as 300 seconds).
      8. Click OK to close the client image notebook.
    10. Skip this step if you did not change the default 2102 OLT port setting in the last step.
      1. In the OLT viewer window, select File > Preferences.
      2. Select OLT from the tree in the Browser Preferences window.
      3. In the OLT Server TCP/IP port field, enter the new port number.
      4. Click OK.
      5. Close OLT and restart it.
  5. To activate your configuration, follow these steps:
    1. Expand Management zones > Sample cell and workgroup zone > Configuration, and select Sample configuration.
    2. Click Sample configuration with the right mouse button, and from the pop-up menu, select Activate.
    3. Monitor the Action Console window for a completion status.

You are now ready to trace and debug the Policy sample using one of the OLT scenarios.

ngrelr.gif (548 bytes)
OLT Overview