Sun ONE logo     
RMI/IIOP Access to EJBs

RMI/IIOP Access to EJBs



Table of Contents


Overview

This sample is based on the Currency Converter EJB sample included in Sun's J2EE Developer's Guide. It demonstrates RMI/IIOP-based access to a simple stateless session bean. This sample will help you to understand how to enable concurrent access to the EJBs via both RMI/IIOP-based Java clients and web-based servlets/JSPs clients. RMI/IIOP-based Java clients are executed inside Application Client Container (ACC) or outside ACC, while the web-based servlets/JSPs clients are executed in Web Container as shown in Figure 1. The section Running the Sample Application demonstrates how to run application client without ACC or with ACC.

Figure 1    Access to EJBs via Java and Web Clients


Compiling and Assembling the Sample Application

This procedure describes how to compile and assemble the sample using a Command Line Interface (CLI).

Deploying the Sample Application

Select CLI or GUI to deploy the application using the EAR file assembled in previous section.

Command Line based Deployment

An alternative way to deploy is to use Application Server Administration Tool. It can also be used to verify the registration, i.e.

GUI Based Deployment


Running the Sample Application

1.   Web-based client.

The Servlets/JSPs client will be run via a browser.

2.   Local RMI/IIOP-based client with ACC.

The Java client will be run on the same machine where the Application Server is running.

3.   Remote RMI/IIOP-based client with ACC.

The Java client will be run on the different machine where the Application Server is running.

4.   Local or remote RMI/IIOP-based client without ACC.

The java client is executed without using the interface of Application Client Container. It can be executed on the local machine (ashost) or a remote machine. The client application runs from the command line, i.e. where As a complete example for the command, it looks like the following for this sample,

On Solaris:

On Windows:

After that, you should see the last two lines from screen as the result of converting 100 units of USD to Yen, and 100 Yen to Euro.


Troubleshooting

Copyright (c) 2002 Sun Microsystems, Inc. All rights reserved.