WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.wtc.atmi.convsimp

This example demonstrates the ability of WebLogic Tuxedo Connector to allow WebLogic Server to interoperate with Tuxedo using conversations.

See:
          Description

Interface Summary
TuxedoConversation The methods in this interface are the public face of the simpapp client.
TuxedoConversationHome 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 TuxedoConversation Buy some shares using the TuxedoConversation Sell some shares using the TuxedoConversation Remove the TuxedoConversation
TuxedoConversationBean ToupperBean is a stateful SessionBean.
 

Package examples.wtc.atmi.convsimp Description

This example demonstrates the ability of WebLogic Tuxedo Connector to allow WebLogic Server to interoperate with Tuxedo using conversations.

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. Create a working Tuxedo convsimp directory.
  3. Copy the following files from the examples.wtc.atmi.convsimp package to your working Tuxedo convsimp directory.
  4. Change directories to the working Tuxedo convsimp directory
  5. 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.
  6. Build the clients:
      buildclient -o convcl -f convcl.c
      buildserver -o convsimp -f convsimp.c -s CTOUPPER
  7. Modify the ubbdomain for your Tuxedo environment. This includes setting the pathnames for APPDIR, TUXCONFIG, and TUXDIR and setting the machine name. Replace all <bracked> items with information for your environment.
      Example:
      APPDIR="d:\my_apps\convsimp"
      TUXCONFIG="d:\my_apps\convsimp\tuxconfig""
      TUXDIR="d:\bea\tuxedo"
  8. Load the ubbdomain file
      Example:
      tmloadcf -y ubbdomain
  9. 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"
  10. Load the dom1config file
      Example:
      set BDMCONFIG=d:\my_apps\convsimp\bdmconfig
      dmloadcf -y dom1config
  11. Boot the Tuxedo domain
      tmboot -y
  12. Verify all processes have started using the tmadmin psc command.The following domain processes should have booted:
    • DMADM, GWADM, and GWTDOMAIN
    • The CTOUPPER service

WLS Configuration

  1. Boot your WebLogic Examples Server
  2. Change directories to the WTC convsimp 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_tux_Conversations.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 simpconv directory
  8. Build the wtc_tux_server_Conversations.jar file using ant.
    • Enter the following command: ant
  9. Check to see that the wtc_tux_Conversations.jar and wtc_tux_server_Conversations.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.
  1. Change directories to the WLS convsimp directory
  2. Start a client

    Example:
       run hello
    The Tuxedo service replies to your WLS application with:
       Beginning statefulSession.Client...
       Creating TuxedoConversation
       datasize: 1 iterations: 1
       End statefulSession.Client...
    Your WebLogic Server display the following:
      setSessionContext called
      ejbCreate called
      conversation called, datasize:1 iterations: 1
      cpcf get sources: jndi.properties
      About to start convesation
      tpconnect successfull!
      first send successful!
      first receive successful!
      second send successful!
      second receive successful!

  3. Untarget the WTCconvsimp Mbean from the examplesServer.

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...

You are ready to run the simpconv example.

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.