WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.iiop.rmi.rmiclient

This directory contains the RMI client which can be used to demonstrate connectivity to a WebLogic Server, as well as server to server connectivity with Tuxedo.

See:
          Description

Class Summary
PingClient This client uses the remote PingServer methods.
 

Package examples.iiop.rmi.rmiclient Description

This directory contains the RMI client which can be used to demonstrate connectivity to a WebLogic Server, as well as server to server connectivity with Tuxedo.

The source code for all the RMI-IIOP examples is in your WL_HOME\samples\server\src\examples\iiop directory. Before you run the client applications in this directory, be sure to build the whole example. This includes building the WebLogic Server and, if you wish to run through the Tuxedo Server, the Tuxedo Server (iiop/rmi/server/tux) as well.

  • Setting up Ping and configuring WebLogic Server

  • Setting up and configuring Tuxedo Server

    It is also crucial that you have your environment set up correctly as detailed in the steps to configure the WebLogic and Tuxedo Servers. If you run into problems, make sure to check your environment; check especially your PATH and CLASSPATH as well as the BDMCONFIG, TOBJADDRESS , and TUXCONFIG variables that are used by Tuxedo. In this example, you will not connect to Tuxedo directly; however, you can make an outbound call to Ping! Tuxedo if you have your Tuxedo Server running.

    Build the example

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

    2. Execute the build script provided for this example in the examples\iiop\rmi\rmiclient directory of your WebLogic Server installation.

    Also check out the code on the client side: PingClient

    Run the Example

    1. Make sure you have started the server following the WL_HOME/samples/server/src/examples/iiop/rmi/server/wls instructions.

    2. Open a separate command-line window in which you will run the client.

    3. Set up the environment for your client as described in Setting up your environment for building and running the examples.

    4. To run the Client you may need to set a security manager. To do so, create a file in the rmiclient directory called java.policy that contains the following:
      grant {
        // Allow everything for now
        permission java.security.AllPermission;
      };

    5. The build script included in this example also contains the command needed to run the client. Check the build.xml script provided in the examples\iiop\rmi\rmiclient directory to make sure it is using your correct port and hostname. The last section of this xml file contains the run command. Run the client by entering:

      ant run

      The ant command runs the client with the following command, check your ip address and port number if you have problems:

      java -Djava.security.manager -Djava.security.policy=java.policy examples.iiop.rmi.rmiclient.PingClient iiop://localhost:7001

    6. To demonstrate server to server connectivity add true to the end of the command (i.e. java examples.iiop.rmi.rmiclient.PingClient iiop://localhost:7001 true. To do so you may add, <arg value="true"/> to the build.xml run command. If you have set up both your environments correctly, the WebLogic Server you have called will make an outbound call to the Tuxedo Server and you should see Ping! in the most current ULOG (located in the directory in which you have booted your Tuxedo Server).

    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.