WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.wtc.atmi.simpapp

This example demonstrates the ability of WTC to allow WLS to interoperate with Tuxedo.

See:
          Description

Interface Summary
Toupper The methods in this interface are the public face of the simpapp client.
ToupperHome This interface is the home interface for the TraderBean.java, which in WebLogic is implemented by the code-generated container class TraderBeanC.
 

Class Summary
Client This class illustrates calling a stateful SessionBean and performing the following exercises: Create a Toupper Buy some shares using the Toupper Sell some shares using the Toupper Remove the Toupper
ToupperBean ToupperBean is a stateful SessionBean.
 

Package examples.wtc.atmi.simpapp Description

This example demonstrates the ability of WTC to allow WLS to interoperate with Tuxedo.

The Tuxedo simpapp application is extended to run over domains. This allows clients of the TOUPPER service to run on either Tuxedo or WLS. It consists of a Tuxedo service, TOUPPER, which converts a string to upper case. A WLS client invokes the TOUPPER EJB and connects to the Tuxedo TOUPPER service.

Configure the example

You need to configure Tuxedo and WLS.

Tuxedo configuration

  1. Your PATH environment variable needs to include the path of your C compiler. Use set PATH to check the status and add the path if necessary.
  2. Copy the simpapp example from your Tuxedo installation and create a working Tuxedo simpapp directory
  3. Change directories to the working Tuxedo simpapp directory
  4. Set environment variables. Update the following parameters:
    NT/2000 users modify setEnv.cmd located at %TUXDIR%. Unix users modify the tux.env file located at $TUXDIR.
  5. Build the clients:
      buildclient -o simpcl -f simpcl.c
      buildserver -o simpserv -f simpserv.c -s TOUPPER
  6. Copy the ubbdomain and dom1config files from the WTC simpapp directory to your Tuxedo simpapp directory
  7. Copy the tolower.c file from the WTC simpserv directory to your Tuxedo simpapp directory
  8. Modify the ubbdomain for your Tuxedo environment. This includes setting the pathnames for APPDIR, TUXCONFIG, and TUXDIR and setting the machine name. Replace all <braced> items with information for your environment.
      Example:
      APPDIR="\home\me\simpapp"
      TUXCONFIG="\home\me\simpapp\tuxconfig""
      TUXDIR="\usr\tuxedo"
  9. Load the ubbdomain file
      Example:
      tmloadcf -y ubbdomain
  10. Modify the dom1config for your Tuxedo environment. This includes creating log devices and updating the network addresses.
    • Logs
      Example:
      DMTLOGDEV="d:\my_apps\tlog"
      AUDITLOG="d:\my_apps\aud"
      DMTLOGNAME="DMTLOG_TDOM1"
    • NWADDR
      Example:
      TDOM1 NWADDR="//TuxedoMachine:1234"
      TDOM2 NWADDR="//WTCMachine:5678"
  11. Load the dom1config file
      Example:
      set BDMCONFIG=d:\mydomain\simpapp\bdmconfig
      dmloadcf -y dom1config
  12. Build the tolower client
      buildclient -v -f tolower.c -o tolower
  13. Boot the Tuxedo domain
      tmboot -y
  14. Verify all processes have started using the tmadmin psc command.The following domain processes should have booted:
    • DMADM, GWADM, and GWTDOMAIN
    • The TOUPPER service offered by the simpserv server
    • The TOLOWER service is offered by the GWTDOMAIN server

WLS Configuration

  1. Boot your WebLogic examplesServer
  2. Change directories to the WTC simpapp directory
  3. Set environment variables. Update the following parameters:
    NT/2000 users modify and run the setExamplesEnv.cmd. Unix users copy ./config/examples/setExamplesEnv.sh script to your WTC simpapp directory, then modify and run the setExamplesEnv.sh script.
  4. Build the wtc_toupper.jar file using ant.
    • Enter the following command: ant
  5. Modify the setWTCMbeans file with information specific to your installation.
    • NT/2000 users modify the setWTCMbeans.cmd file. Unix users modify the setWTCMbeans.sh file.
    • Update the NWAddr attributes of TDOM1 and TDOM2 domains for your environment
    • If you are using a Tuxedo 6.5 service, add Interoperate and set to yes
    • Set the user and passwd for your environment
  6. Run the setWTCMbeans file to configure your installation.
    • NT/2000 users run the setWTCMbeans.cmd file.
    • Unix users run the setWTCMbeans.sh file.
  7. Change directories to the simpserv directory
  8. Build the wtc_tolower.jar file using ant.
    • Enter the following command: ant
  9. Check to see that the wtc_tolower.jar and wtc_toupper.jar are deployed. Use the WLS console or check the config.xml file. Manually deploy the EJBs if needed.

Run the example

Start a WLS client to invoke the TOUPPER EJB and connect to the Tuxedo TOUPPER service.
  1. Change directories to the WLS simpapp directory
  2. Start a client

    Example:
       run allcaps
    The Tuxedo service replies to your WLS application with:
       Returned string is: ALLCAPS
  3. You are ready to run the simpserv example.

Use TraceLevel

If you have a problem running the simpapp example, use the WTC tracing feature. Add the TraceLevel attribute to your startWebLogic script.
Example:
   -Dweblogic.wtc.TraceLevel=20000
A TraceLevel of 20000 traces all of the calls to the Tuxedo object in the client.

There's more...

For more information about WebLogic Server WebLogic Tuxedo Connector, see:


Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.