WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.iiop.rmi.server.tux

This example illustrates connectivity between a variety of clients, Tuxedo and WebLogic Server using a simple Ping program. To build the C++ client you will need Inprise Visibroker 4.1 for C++ and a C++ compiler. It is also necessary that you have Tuxedo 8.0 with Rolling Patch 15 or later if you wish to run the clients through Tuxedo or make outbound calls to Tuxedo. The source code for all the RMI-IIOP examples is in your WL_HOME\samples\server\src\examples\iiop directory. To get the most out of this example, first read through the source code files to see what is happening. Start with the XML build files to find the general structure of the example, i.e. which classes are used for the different objects and interfaces, then examine the other files to see how the applications work.

Pay close attention to setting up your Tuxedo environment as there are many pitfalls when attempting to run Tuxedo and WebLogic in conjunction. There are three different clients that can be executed; examine the XML build file carefully for each one. Take special note to see how the idl files are created for the C++ and Tuxedo clients as well as the Tuxedo server. This example also presumes familiarity with BEA Tuxedo. For further information on Tuxedo and especially how to administer and configure a Tuxedo Server, it is highly recommended that you view their online documentation

If you run into problems, make sure to check your environment; check especially your PATH and CLASSPATH as well as the BDMCONFIG, TOBJADDR , and TUXCONFIG variables that are used by Tuxedo. Make sure you have the proper settings that include the necessary Tuxedo directories in your PATH; make sure you have TUXDIR set to your installation of Tuxedo 8.0 and that you have included the tuxedo8.0/bin and tuxedo8.0/lib directories in your PATH. It is recommended to get these examples first working with WebLogic Server before attempting to introduce the Tuxedo Server

The source code for all the RMI-IIOP examples is in your WL_HOME\samples\server\src\examples\iiop directory. The following section describes how to build and run the example:

  1. Build the example
  2. Configure the server
  3. Run the example

Build the example

  1. If you have not built the WebLogic Server portion of this example, do that before you move on to the Tuxedo portion.

  2. Set up your development shell as described in Setting up your environment.

  3. Execute the build script provided for this example in the samples\examples\iiop\ejb\server\tux directory of your WebLogic Server installation. The script will perform the following steps:

    1. Create the appropriate directory structure

    2. Run rmic to create the rmi class.

  4. Compile the application, ping_server.exe

Configure the Tuxedo server and WebLogic

  1. Edit you config.xml or use the console to make sure you have included PingImpl as a startup class:
        <StartupClass
          Arguments="tuxedo.corba.remote"
          ClassName="examples.iiop.rmi.server.wls.PingImpl"
          FailureIsFatal="false"
          Name="Pinger"
          Targets="examplesServer"
        />

  2. Boot your WebLogic examplesServer

  3. Modify the setWTCMbeans file with information specific to your installation.

  4. Run the setWTCMbeans file to configure your installation.

  5. Add a user to WebLogic named TDOM1.

  6. Go to your <TUXDIR>/samples/corba/cnssimpapp directory and run runme.cmd, this will verify that you Tuxedo installation is correct and builds an example. For more information on this example and setting up your Tuxedo environment, see the Tuxedo documentation. You will have to edit your environment to include a BDMCONFIG entry. This path should lead to a blank unformatted file as it will contain domain information stored in binary format. For example: set BDMCONFIG=C:\BEA_HOME\tuxedo8.0\samples\corba\cnssimpapp\results\my_bdm. The my_bdm file should begin as blank unformatted file. Do not get this confused with the bdmconfig.xml file that configures the WebLogic side of communication.

  7. Copy the files ping_server.exe, ubbdomain, and dom1config from the WL_HOME/samples/server/src/examples/iiop/rmi/server/tux directory. Paste them into the <TUXDIR>/samples/corba/cnssimpapp directory.

  8. Edit the <TUXDIR>/samples/corba/cnssimpapp/ubbdomain and dom1config files for your particular setup. The ubbdomain file configures your Tuxedo Server and applications in a Tuxedo domain. You will have to change the MACHINES and ISL sections to contain your own machine name, i.p. address and port information. The dom1config file configures connectivity for remote domains (In this case WebLogic Server) and gets turned into binary format, replacing the my_bdm file you have already created. For more information on setting up your Tuxedo environment, see the Tuxedo documentation.

  9. Load the ubbdomain using tmloadcf -y ubbdomain. Load the dom1config using dmloadcf -y dom1config and boot the Tuxedo system using tmboot -y.

  10. Make sure TOBJADDR is set correctly in your environment and with the correct ip_address (localhost or machine name may not work). For instance to //<ip_address>:2468//<hostname>:2468

  11. Register WLS in the CosNaming namespace by doing:

    cnsbind -o ior.txt WLS

    The ior.txt is included in the WL_HOME\samples\server\src\examples\iiop\rmi\server\tux directory, and should be appropriately edited for the domain you are using for your WebLogic server (examples if you are following the example explicitly).

Run the example

    There are different client applications included in this example. Each requires different steps to build and execute. The following links contain information pertinent to each respective client.

    RMI Client

    C++ Client (requires visibroker 4.1)

    Tuxedo Client (requires Tuxedo 8.0)

There's more...

Read more about WebLogic RMI over IIOP in the Developer Guide, Using WebLogic RMI over IIOP.

Read more about WebLogic EJB in the Developer Guide, BEA WebLogic Server Enterprise JavaBeans.

Read more about WebLogic RMI in the Developer Guide, Using WebLogic RMI.

For more information on how to provide interoperability between WebLogic Server applications and Tuxedo services, see WebLogic Tuxedo Connector.


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

Copyright © 2002 BEA Systems, Inc. All rights reserved.