SDSU CS 696 Emerging Technologies: Java Distributed Computing
Spring Semester, 1999
Activation & rohan
Previous    Lecture Notes Index    Next    
© 1999, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 11-Mar-99

Contents of Doc 14, Activation & rohan


Java Remote Method Invocation Specification, chapter 7 & pp. 122
Local HTML Copy:
Sun HTML Site:

rmid documentation
Sun Copy:
Private communication & rmi mailing list

Doc 14, Activation & rohan Slide # 2

rmid & Port Number

Server Side

How does your Server registration program find rmid if it is not on the standard port?

Solution 1
Set the system property java.rmi.activation.port in the JVM what registers the server

Doc 14, Activation & rohan Slide # 3
Solution 2
Use the rmid registry
package whitney.rmi.examples.activation;
import java.rmi.*;
import java.rmi.activation.*;
import java.util.Properties;
public class RegisterHelloServer 
   public static void main(String[] args) throws Exception 
      System.setSecurityManager(new RMISecurityManager());
      Properties policyFileLocation = new Properties(); 
      ActivationGroupDesc.CommandEnvironment ace = null; 
      ActivationGroupDesc exampleGroup = 
         new ActivationGroupDesc(policyFileLocation, ace);
       ActivationSystem localActivationSystem;
       localActivationSystem = (ActivationSystem)
      ActivationGroupID agi = 

Doc 14, Activation & rohan Slide # 4
RegisterHelloServer Continued

      System.out.println( "after register group" );
      ActivationGroup.createGroup(agi, exampleGroup, 0);
      String classLocation = "file:/export/home/whitney/java/classes/";
      String serverClass = 
      MarshalledObject data = null;
      ActivationDesc desc = 
         new ActivationDesc(serverClass, classLocation, data);
      Hello mri = (Hello)Activatable.register(desc);
      System.out.println("Got the stub for the HelloServer");
      Naming.rebind("//:6754/HelloServer", mri);
      System.out.println("Exported HelloServer");

Doc 14, Activation & rohan Slide # 5
rmid & Port NumberClient Side

The hostname and port number of rmid is part of the stub downloaded to the client when it contacts the rmiregistry.

rmid is responsible for setting this information in the stub

On rohan this information is not set correctly.

You can use the –C-D and –J-D flags to set the correct value.

rmid -J-Djava -port 6753 &

However, there is still a problem on rohan.

At this time on rohan or moria

Do not use the above flags
Do not test your clients remotely on servers implementing the Activatable interface

Copyright ©, All rights reserved.
1999 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 11-Mar-99    Next