Give a man a program, frustrate him for a day. <i>Teach</i> a man to program, frustrate him for a lifetime.

RMI: Programmer Checklist

Source

The interface

The server (implementation of the interface)

The client

Compiling

Running

For example, the command below runs a Java application called Application. In this case, the system expects the policy file called policy to be in the directory from which the java command executes.

Class files in my public_html/classes directory to be readable by all. The classes directory needs to be readable and executable by all. The trailing slash on the codebase specification is crucial.

Starting with Java 7, the Java.rmi.server.useCodebaseOnly=false is needed to enable the application to download code from another JVM (e.g., a compute engine downloading task classes from a remote client). (See ttps://docs.oracle.com/javase/7/docs/technotes/guides/rmi/enhancements-7.html"> for an explanation.)

Runtime Exceptions

java.io.NotSerializableException

The object, Obj, in question either:

java.rmi.ConnectException: Connection refused to host: ...

This probably is due to your server not exporting itself: Please see the first bullet point under the section above titled "The server (implementation of the interface)."

java.security.AccessControlException: access denied

The JVM may not have access to a policy file, either because:



 cappello@cs.ucsb.edu © Copyright 2010 Peter Cappello                                           2016.04.08