Skip Headers

Oracle9iAS Containers for J2EE Services Guide
Release 2 (9.0.2)

Part Number A95879-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

3
Remote Method Invocation

Remote Method Invocation (RMI) is Java's implementation of the remote procedure call paradigm, in which distributed applications communicate by invoking procedure calls and interpreting the return values. This chapter discusses how to configure Oracle9iAS Containers for J2EE (OC4J) to support invoking RMI over HTTP, a technique known as "RMI tunneling."

Configuring RMI Tunneling

To configure OC4J to support RMI tunneling, do the following:

  1. Modify the JNDI provider URL. The JNDI provider URL for accessing the OC4J EJB server takes the form:

    ormi://<hostname>:<ormi_port>/<the_app>
    

    You should change the URL to:

    http:ormi://<hostname>:<HTTP_PORT>/<the_app>
    


    Note:

    If omitted, <HTTP_PORT> defaults to 80. The argument port number is your HTTP port, not your ORMI port.


  2. If your HTTP traffic goes through a proxy server, you must specify the proxyHost and (optionally) proxyPort in the command line when starting the EJB client. If you do not supply a value for proxyPort, it defaults to 80.

    -Dhttp.proxyHost=<proxy_host> -Dhttp.proxyPort=<proxy_port>
    

Configuring RMI In server.xml and rmi.xml

In order to use RMI from OC4J, you must edit the server.xml and rmi.xml files.

Editing server.xml

Your server.xml file must specify the pathname of the RMI configuration file. The syntax is:

<rmi-config path="<RMI_PATH>" /> 

The usual <RMI_PATH> is ./rmi.xml; you can name the file whatever you like.

Editing rmi.xml

The file rmi.xml must specify which host, port, and user information will be used to connect to (and accept connections from) remote RMI servers. Your file must contain an <rmi-server> element describing possible connections. An <rmi-server> element looks like:

<rmi-server host="hostname" port="port"> 
<server host="hostname" username="username" port="port"  
  password="password" http-path="pathname"/> 
<log> 
  <file path="logfilepathname" /> 
</log> 
</rmi-server> 

<rmi-server> has the following attributes:

hostname

is the host or IP name from which your server will accept RMI requests. hostname can be a particular hostname or "[ALL]". If you specify a hostname, the OC4J server will only accept RMI requests from that particular host. If hostname is "[ALL]"or you omit the host attribute, the OC4J server will accept RMI requests from any host.

port

is the port number on which your server listens for RMI requests. If you omit this attribute, it defaults to 23791.

An <rmi-server> element can contain zero or multiple <server> elements and zero or one <log> elements.

Each <server> element specifies a server that your application can contact over RMI. A <server> element takes the form:

 <server host="hostname" username="username" port="port"  
    password="password"/> 

The host attribute is required; the remaining attributes are optional.

hostname

the name or IP address of the server you will contact over RMI.

username

the username of a valid principal on the remote server

port

the port number on which the remote server listens for RMI requests

password

the password used by the principal username

The <log> element contains the pathname of a log file to which the server will write all RMI requests.


Go to previous page Go to next page
Oracle
Copyright © 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index