Oracle9iAS Containers for J2EE Services Guide Release 2 (9.0.2) Part Number A95879-01 |
|
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."
To configure OC4J to support RMI tunneling, do the following:
ormi://<hostname
>:<ormi_port
>/<the_app
>
You should change the URL to:
http:ormi://<hostname
>:<HTTP_PORT
>/<the_app
>
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
>
In order to use RMI from OC4J, you must edit the server.xml
and rmi.xml
files.
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.
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:
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.
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.
the name or IP address of the server you will contact over RMI.
the username of a valid principal on the remote server
the port number on which the remote server listens for RMI requests
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.
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|