Package examples.rmi.hello

This package takes the simple "HelloWorld" RMI example that is supplied in the RMI distribution from Sun to illustrate how easy it is to convert your RMI classes to use WebLogic RMI.

See:

 

Interface Summary

Hello This interface is the remote interface.
 

 

Class Summary

HelloClient This client uses the remote HelloServer methods.
HelloImpl This simple example is available as part of Sun's distribution package.
 

Package examples.rmi.hello Description

This package takes the simple "HelloWorld" RMI example that is supplied in the RMI distribution from Sun to illustrate how easy it is to convert your RMI classes to use WebLogic RMI.

In this package the Remote interface "Hello," is implemented by the "HelloImpl" class. The "HelloClient" class invokes the Remote class from a simple java client.

Also included in this directory are build scripts for NT, Microsoft SDK for Java, and UNIX. The script compiles the files in this directory and runs the WebLogic RMI compiler on the implementation class.

There are detailed instructions on converting Sun RMI classes to use WebLogic RMI in the Developers Guide. The instructions here are brief and assume that you have or will look at the Developers Guide.

The following section describes how to build and run the examples:

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

Build the example

  1. Set up your development shell as described in Setting up your environment.
  2. Change to the $SAMPLES_HOME\server\examples\src\examples\rmi\hello directory, where $SAMPLES_HOME refers to the main WebLogic Server examples directory, such as d:\beahome\weblogic81\samples.
  3. Run the build script using the following Java ant command:

            prompt> ant

    The script will build the example and place the files in the correct locations in your WebLogic Server distribution:

    • Client files: in SAMPLES_HOME\server\examples\build\clientclasses\
    • EJBean: in SAMPLES_HOME\domains\examples\applications\rmi_hello.jar

Configure the server

Register the HelloImpl class as an RMI startup class
  1. Start the server with the examples configuration in a new command shell.
  2. Bring up the Administration Console in your browser.
  3. Click to expand the Deployments node in the left pane.
  4. Click to expand the Startup & Shutdown node in the left pane.
  5. Select the hello startup class.
  6. Select the Target and Deploy tab in the right pane to display the servers and clusters on which you can deploy this startup class.
  7. Click examplesServer.
  8. Click Apply.

Run the example

  1. Since startup classes are only activated when the server boots, you will need to re-start the server with the examples configuration.

  2. In you development shell, run the client application with the following command:
      prompt> ant run  

There's more...

Read more about this WebLogic service in the Developers Guide, Using WebLogic RMI to get more detailed information for your application.