RMI on JDK 1.0.2 Release Notes

(With Netscape Support)

These release notes are current for build bl59 of this release. These release notes contain the following sections:

Overview

This is the final release of RMI for JDK 1.0.2. This RMI release is compatible with:

This RMI release is NOT compatible with the RMI Prebeta1 release.

Note that this release requires local installation of the RMI package appropriate for Solaris or Win95/NT.

Examples

This release of RMI ships with two examples. The first is a distributed version of Hello World, which has an accompanying tutorial that explains the basics of using RMI. The second example is a stock monitoring applet that receives notification when the values of the portfolio change and that demonstrates callbacks from an object exported by the applet.

Running Applets in Netscape

If you have already developed an applet that uses RMI Prebeta1, then no changes are required to your code. You must, however, include the sunw.io.ObjioAppletHelper class file in the applet's codebase. The source code for this class has been included, and can be found in the rmi/lib directory. This class must be compiled and installed.

Note that once the sun.io.ObjioAppletHelper class is in the applet's codebase, your applet will be compatible with the RMI extension for Netscape. Without this class, your applet is compatible only with the special version of HotJava that ships with this release and the appletviewer.

ObjioAppletHelper is used to facilitate compatibility with the Netscape Java Virtual Machine implementation. When called by the serialization runtime, the context of the applet and return information cannot be retrieved from native code. This helper class provides that information. Once browser vendors incorporate JDK 1.1 support, this file will no longer be necessary. If the ObjioAppletHelper class cannot be found at runtime, the error java.lang.ClassFormatError may show up in the java console window.

Important Note: For an applet using RMI to work with Netscape, the containing web page must be loaded from an HTTP URL, not a file URL. This is because when the page is loaded from file:, Netscape won't let the applet make a socket connection.

Serializing Objects and Versioning

Objects must explicitly declare that they can be sent outside their VM by implementing either the interface java.io.Serializable or the interface java.io.Externalizable. The list of core classes that implement the Serializable interface are as follows:

To support versioning of classes, each version of a class except the first must specify the serialVersionUID variable. This variable indicates the original class version for which the current class is capable of writing streams and from which it can read. For example:

      static final long serialVersionUID = 3487495895819393L; 

To retrieve this value, use the method ObjectStreamClass.getSerialVersionUID or the serialver tool.

RMI through Firewalls via a CGI Program (required under limited conditions)

For a server to support RMI calls from clients behind firewalls that do not foward HTTP requests to arbitrary ports, a CGI program needs to be installed on the server host's default HTTP server (listening on port 80). (Without installion of the CGI program, the server will still support RMI calls from clients behind typical firewalls.)

The CGI program "java-rmi.cgi" is responsible for forwarding HTTP-packaged RMI calls sent to the default HTTP server to be forwarded to an RMI server listening on a port specified in the URL. Specifically, when a POST request is sent with the URL path "/cgi-bin/java-rmi.cgi?forward=port", the body of the request will be sent (as another POST request) to the server listening on the specified port (must be >= 1024). The HTTP response from this forwarded request will be the response to the original request.

On Solaris:

Copy the file "$RMIHOME/lib/solaris/java-rmi.cgi" to the directory to which your HTTP server maps the URL path "/cgi-bin". You will need to edit this script to fill in the proper path for the Java interpreter on the host machine, as noted in the script comments.

On Windows 95/NT:

Copy the file "$RMIHOME/lib/win32/java-rmi.cgi" to the directory to which your HTTP server maps the URL path "/cgi-bin". For this program to execute correctly, the system PATH environment variable must include the directory for the Java interpreter.

Fixed Bugs

Known Limitations and Bugs