Package examples.wtc.corba.simpappcns

This example demonstrates the ability to use WTC to allow Tuxedo or WLS clients to run CORBA applications using the Corba Name Service.

See:

 

Interface Summary

ToupperCorba The methods in this interface are the public face of the simpapp client.
ToupperCorbaHome This interface is the home interface for the ToupperCorbaBean.java, which in WebLogic is implemented by the code-generated container class ToupperCorbaBeanC.
 

 

Class Summary

Client This class illustrates calling a stateful SessionBean and performing the following exercises: Create a ToupperCorba Convert a string using ToupperCorba Remove the ToupperCorba
ToupperCorbaBean ToupperCorbaBean is a stateful SessionBean.
 

Package examples.wtc.corba.simpappcns Description

This example demonstrates the ability to use WTC to allow Tuxedo or WLS clients to run CORBA applications using the Corba Name Service.

The simpappcns example takes the Tuxedo 8.0 CORBA cnssimpapp application and extends it to run over domains, such that the clients for the to_upper method can either run on Tuxedo or on WLS.

This example uses two domains:

  • The classical TUXEDO domain is called TUXDOM.
  • A WLS domain called examples.

Note: NT/2000 machines with multi-homed Ethernet adapter may have difficulty running this example. If you continually receive the following message: Error connecting to Tuxedo Domain, consider using a machine with an Ethernet adapter having a single address.

Configure the example

You need to configure Tuxedo and WLS.

Tuxedo configuration

  1. Create a working directory containing the cnssimpapp example. Copy the TUXEDO CORBA cnssimpapp example from your Tuxedo installation and place it in your working cnssimpapp directory. Make sure the qualified path name and file name for the tuxconfig file contains less that 64 characters.

  2. Set environment variables. Update the following parameters:
    • TUXDIR - base directory of the TUXEDO Software
    • APPDIR - base directory of the sample program
    • PATH - must include %TUXDIR%\bin
    • TUXCONFIG - full pathname of binary tuxconfig file
    • TOBJADDR - hostname and port of the Tuxedo Object
    NT/2000 users modify setEnv.cmd located at %TUXDIR%. Unix users modify the tux.env file located at $TUXDIR.

  3. Build the clients:
      NT/2000 users enter the following command: nmake -f makefile.nt all
      Unix users enter the following command: nmake -f makefile.mk all

  4. Copy the files ubbdomain and dom1config from the WL_HOME/samples/server/examples/src/examples/wtc/corba/simpappcns directory. Paste them into your working cnssimpapp directory.

  5. 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="my_apps/cnssimpapp"
      TUXCONFIG="my_apps/cnssimpapp/tuxconfig"
      TUXDIR="bea/tuxedo8.0"

  6. Modify the dom1config for your Tuxedo environment. This includes creating log devices and updating the network addresses.
    • Logs
      Example:
      DMTLOGDEV="d:\my_apps\cnssimpapp\DMTLOG"
      DMTLOGNAME="DMTLOG_TUXDOM"
    • NWADDR
      Example:
      TUXDOM NWADDR="//TuxMachine:20305"
      examples NWADDR="//WLSMachine:20304"

  7. Load the ubbdomain file
      Example:
      tmloadcf -y ubbdomain

  8. Set the location of your bdmconfig file and load the dom1config file
      Example:
      set BDMCONFIG=my_apps\cnssimpapp\bdmconfig
    then:
      dmloadcf -y dom1config

  9. Boot the Tuxedo domain
      tmboot -y

  10. Verify your Tuxedo configuration by running a remote client using the following command:
      simple_client -ORBid BEA_IIOP
    You should be prompted for a string. A Tuxedo process will convert the string to all capital letters.
      String? helloworld
    You should recieve the following messages:
      HELLOWORLD
      helloworld

WLS Configuration

  1. Boot your WebLogic Examples Server
    • Make sure that no other WTC services are targeted to the examplesServer
  2. Change directories to the WTC simpappcns directory
  3. Set environment variables. Update the following parameters:
    • Set the APPLICATIONS to the location of the applications directory in your WebLogic Server installation
    • Set the CLIENT_CLASSES to build
    NT/2000 users modify and run the setExamplesEnv.cmd. Unix users copy ./config/examples/setExamplesEnv.sh script to your WTC simpappcns directory, then modify and run the setExamplesEnv.sh script.
  4. Build the wtc_toupper_corba.jar file using ant.
    • Enter the following command: ant
  5. Check to see that the wtc_toupper_corba.jar is deployed. Use the WLS console or check the config.xml file. Manually deploy the EJB if needed.
  6. Configure your WTC simpappcns service.
    • Enter the following command: ant setwtc

    You will be promped for your username, password, and the network addresses for your examples local Tuxedo access point and your TUXDOM remote Tuxedo access point. The following is an example of a successful configuration:
    Buildfile: build.xml
    setwtc:
    [input] Enter system username:
    weblogic
    [input] Enter system password:
    weblogic
    [input] Enter the Network Address for your local access point, examples:
    //WLSMachine:20304
    [input] Enter the Network Address for your remote access point, TUXDOM:
    //TuxMachine:20305
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    [java] Ok
    BUILD SUCCESSFUL

Run the example

Start a WLS client which connects to the Tuxedo CORBA application and invokes to_upper.

From the WTC simpappcns directory, start a client:

  • Use the following command: ant run

The service returns the following:

Buildfile: build.xml
run:
[java]
[java] Beginning statefulSession.Client...
[java]
[java] Creating ToupperCorba
[java]
[java] converting HereIsAString
[java] converted to: HEREISASTRING
[java]
[java] End statefulSession.Client...
[java]
BUILD SUCCESSFUL

Use the WLS Console to untarget the WTCsimpappcns service from the examplesServer.

Use TraceLevel

If you have a problem running the simpappcns example, use the WTC tracing feature. Add the TraceLevel attribute to your startWebLogic script.
Example:
   -Dweblogic.wtc.TraceLevel=100000
A TraceLevel of 100000 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: