
CECS 327
Assignment 7 (10 points) – Due Monday, 11/3/08
This assignment is to be done on Linux. It consists of three parts:
Part I. Learn about the basic components of Java RMI programs by following the steps below:
1. Create a subdirectory named “rmi-part1” in your “327” directory.
2. Copy all files from ~lam/327/rmi-sample into the above subdirectory
3. Compile the server-side programs as follows:
javac HelloInterface.java
javac Hello,java
javac HelloServer.java
4. Process the implementation class “Hello.class” and generate the sub file for the remote object:
rmic Hello
5. Start the Object Registry by using the following command:
rmiregistry &
6. Activate the object server as a background job:
java HelloServer &
7. Compile the client-side program as follows:
javac HelloClient.java
8. Run the client program (xyz is IP address or domain name of the host where the remote object is):
java HelloClient xyz
Part II. Separate the server-side programs and the client-side into two separate subdirectories:
1. Kill the remote object registry and the server processes.
2. Create two subdirectories named “hello-part2-server” and “hello-part2-client” in
your “327” directory.
3. Copy the following files from “hello-part1” into the above subdirectories:
“HelloClient.class” into your “hello-part2-client” subdirectory
“HelloInterface.class”, “Hello.class”, “Hello_Stub.class”and
“HelloServer.class” into your “hello-part2-server” subdirectory
4. Start the Object Registry by using the following command:
rmiregistry &
5. Activate the object server as a background job:
java HelloServer &
6. Activate the client in the “Hello-part2-client” subdirectory:
java HelloClient xyz
What happens when this command is executed? If errors are encountered, explain what went wrong,
and do the following:
7. Obtain a copy of the remote interface class file and the stub file for the implementation of the
interface by copying them from the “hello-part2-server” subdirectory into “hello-
part2-client” subdirectory, and activate the client program.