These release notes are current for build bl59 of this release. These release notes contain the following sections:
This is the final release of RMI for JDK 1.0.2. This RMI release is compatible with:
In addition to fixing bugs in the Prebeta release, this release enables RMI support in Netscape Navigator 3.01 on Solaris, Windows NT and Windows 95. At this time, Netscape Navigator does not support the JDK 1.1, so this release provides RMI support until Netscape incorporates the JDK 1.1 in their browser. The RMI extension should be considered Prebeta software, and as such, not suitable for use in a production environment. It is also important to note that this release will only work with Netscape Navigator 3.01 on Win32 and Solaris; this extension is only meant as a bridge until Netscape supports JDK 1.1.
Note that this release requires local installation of the RMI package appropriate for Solaris or Win95/NT.
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.
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.
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:
java.lang
, the classes Character,
Boolean, String, Throwable, Number, and StringBuffer
java.util.Hashtable
, the classes Random, Vector, Date, and BitSet
java.io.File
java.net.InetAddress
java.awt
, the classes BorderLayout,
Color, Component, Dimension, Event, Font,
Polygon, CardLayout, FontMetrics, Image,
Window, FlowLayout, GridLayout, Point,
Rectangle, MenuComponent, Insets, CheckboxGroup,
MediaTracker, GridBagLayout, GridBagConstraints,
Cursor, and SystemColor
.
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.
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.
java.rmi.dgc.standalone
set to true, or else they would
get an exception "Unable to contact distributed garbage collector."
Setting this property is no longer required in this situation.
java.rmi.StubNotFoundException("Remote object not
exported")
due to a bug in the JDK 1.0.2 garbage collection. In
this release, we provide a workaround for this bug.
ClassNotFoundError
no longer incorrectly occurs
when unmarshaling a Vector of objects loaded through a class loader.
java.rmi.server.Unreferenced
is now implemented.
equals
method now correctly compares a remote object equal to itself
if it is sent from a server S to a client C as the return
value of a remote method, and then C sends that same object back to S.
java.io.URL
(for serialization compatibility, but not for Netscape)
java.io.File
(for serialization compatibility)
java.net.InetAddress
(bug fix)
java.util.Hashtable
(for serialization compatibility)
java.util.Date.java
(for serialization compatibility)
sun.net.www.protocol.file.Handler
(bug fix)
java.rmi.UnexpectedException: Unexpected exception; nested exception is: java.io.IOException: unable to contact distributed collector
. This usually means that the machine running the applet isn't in the DNS maps properly. Ensure that DNS is properly configured and that the machine you're using is in your network's DNS maps.
java.net.InetAddress
and java.net.URL
are not serializable when runing applets in Netscape.
java.util.Random
is not compatible with the
corresponding class in JDK1.1Beta. If an object of this class is
passed the result will be the exception; java.io.InvalidClassException: java.util.Random; Local class not compatible.
java.rmi.server.UnicastRemoteObject
, and the application does not export the object explicitly before it is passed in an RMI call, the call will succeed in this release. The correct behavior is for the RMI call to fail when trying to pass an unexported remote object.
java.rmi.server.RMISocketFactory
is not implemented for Prebeta.
It provides an interface for specifying how the RMI transport should
obtain sockets.
RMIFailureHandler
is not implemented for this release. It provides a
method for specifying how the RMI runtime should respond when server socket
creation fails.
bind
,
rebind
, and unbind
will throw an AccessException
in cases where it
should not. The Registry implementation restricts these operations
to clients on the same host as the Registry. If the hostname or IP
address does not match, the exception is thrown. In some DHCP and PPP
network configurations the assigned IP address and hostname do not
match the name assigned to the node. A workaround is to statically
and explicitly assign the IP address for the node.
On Solaris, another alternative is to change the node name have the IP address assigned by PPP, or to set the nodename to "localhost" which is bound to the IP address 127.0.0.1.
System.exit()
to exit the application.
RMIClassLoader
(using the property java.rmi.server.codebase
to locate the skeletons),
an exception will be thrown if the remote object implementation to
which the skeleton dispatches makes an RMI call. This is because the
RMISecurityManager
restricts classes loaded by it from connecting to
any host. Skeletons should be available to the server via CLASSPATH so
that the less restrictive default class loader is used (even if they are
also available via codebase).
rmic
does not currently flag an error if a remote interface implemented
by a remote class is not public.
java.rmi.registry.Registry
interface does not
handle stub classes evolving over time. If a remote object
implementation adds support for an additional interface after its
previous stub was loaded into the registry, object serialization will
flag a class mismatch when binding the new stub in the registry. As a
workaround, a registry must be stopped and restarted if changes are made
to the remote interfaces implemented by remote object implementation classes.