SDSU 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

  1. References
  2. RMI, Rohan & Moria
    1. What is Supposed to Happen
    2. What did Happen?
    3. The Solution

References


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

Doc 10, Rohan & Moria RMI Problems Slide # 2

RMI, Rohan & Moria

What is Supposed to Happen



1. Start RMI

2. Register Server

Server is started on a random port and gives RMI Registry, label, port number and host machine name


Doc 10, Rohan & Moria RMI Problems Slide # 3

3. Client connects with RMI Registry

RMI Registry gives client server information

4. Client talks to server

Doc 10, Rohan & Moria RMI Problems Slide # 4

What did Happen?


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!

Doc 10, Rohan & Moria RMI Problems Slide # 5

The Solution


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