CONTENTS | PREV | NEXT | Java Remote Method Invocation |
Note - The host name should not be specified as the host's IP address, because some firewall proxies will not forward to such a host name.
1. | In order for a client outside the server host's domain to be able to invoke methods on a server's remote objects, the client must be able to find the server. To do this, the remote references that the server exports must contain the fully-qualified name of the server host. |
Depending on the server's platform and network environment, this information may or may not be available to the Java virtual machine on which the server is running. If it is not available, the host's fully qualified name must be specified with the property java.rmi.server.hostname when starting the server. |
For example, use this command to start the RMI server class ServerImpl on the machine chatsubo.javasoft.com: |
java -Djava.rmi.server.hostname=chatsubo.javasoft.com ServerImpl
2. | If the server will not support RMI clients behind firewalls that can forward to arbitrary ports, use this configuration: |
a. | An HTTP server is listening on port 80. |
b. | A CGI script is located at the aliased URL path /cgi-bin/java-rmi. This script: |
- | Invokes the local Java interpreter to execute a class internal to the transport layer which forwards the request to the appropriate RMI server port. |
- | Defines properties in the Java virtual machine with the same names and values as the CGI 1.0 defined environment variables. |
An example script is supplied in the RMI distribution for the Solaris and Windows 32 operating systems. Note that the script must specify the complete path to the java interpreter on the server machine. |