|
CS 696 Emerging Technologies: Distributed Objects |
|
---|
Spring Semester, 1998
Rohan & Moria RMI Problems
To Lecture Notes Index
© 1998, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 21-Apr-98
Contents of Doc 10, Rohan & Moria RMI Problems
- References
- RMI, Rohan & Moria
- What is Supposed to Happen
- What did Happen?
- The Solution
java.rmi.server.UnicastRemoteObject
on-line class documentation at
http://www.sdsu.edu/doc/jdk1.1/docs/api/java.rmi.server.UnicastRemoteObject.html
Archive of
RMI-USERS Mailing List at
http://java.sun.com/products/jdk/rmi/archives/index.html
1. Start RMI
2. Register Server
Server is started on a random port and gives RMI Registry, label, port number
and host machine name
3. Client connects with RMI Registry
RMI Registry gives client server information
4. Client talks to server
Server did not know its host name
When Client contacted RMI registry it assumes or is told that the server is on
the local host, i.e. the client machine
Client tries to connect to server on its machine, but server is not there!
Tell the server it's host name by using the property:
- -Djava.rmi.server.hostname
java -Djava.rmi.server.hostname=rohan.sdsu.edu HelloServer &
This can be set in the properties file for java or inside your program
If you do it in your program make sure you do it before registering server with
RMI Registry (I have not tested this last statement)
visitors since 10-Feb-98