United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4330871 RMI registry couldn't be created on several ports within a same JVM
4330871 : RMI registry couldn't be created on several ports within a same JVM

Details
Type:
Bug
Submit Date:
2000-04-17
Status:
Closed
Updated Date:
2000-04-17
Project Name:
JDK
Resolved Date:
2000-04-17
Component:
core-libs
OS:
solaris_2.5
Sub-Component:
java.rmi
CPU:
sparc
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.3.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

Name: acR10002			Date: 04/17/2000


Application couldn't create an RMI registry if it was previously created on a
different port within the same JVM. Below is a short example which demonstrates 
this problem :

--------------------------------- RegTest.java ----------------------------
import java.rmi.RemoteException;
import java.rmi.registry.*;

public class RegTest {
   
    public static void main(String args[]) {

        Registry reg1 = null;
        Registry reg2 = null;
        int port1 = 2098;
        int port2 = 3000;
        boolean passed = true;

        // Create registry on port I
        try {
            reg1 = LocateRegistry.createRegistry(port1);
        } catch (RemoteException e) {
            System.out.println("Failed to create registry on port I : " + e);
            passed = false;
        }
        
        // Create registry on port II
        try {
            reg2 = LocateRegistry.createRegistry(port2);
        } catch (RemoteException e) {
            System.out.println("Failed to create registry on port II : " + e);
            passed = false;
        }
        System.out.println(passed ? "Test passed." : "Test failed.");
        System.exit(0);
    }
}

----------------------------- end of RegTest.java -------------------------

Output from test :
---------------------------------------------------------------------------
% java -version
java version "1.3.0rc3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc3-Z)
Java HotSpot(TM) Client VM (build 1.3.0rc3-Z, interpreted mode)
% javac RegTest.java 
% java RegTest
Failed to create registry on port II : java.rmi.server.ExportException: internal error: ObjID already in 
use
Test failed.
---------------------------------------------------------------------------
The usage of another factory method :
LocateRegistry.createRegistry(int,RMIClientSocketFactory,RMIServerSocketFactory)
will give the same output.

======================================================================

                                    

Comments
EVALUATION

This is a duplicate of 4267864.
ann.wollrath@East 2000-04-17
                                     
2000-04-17



Hardware and Software, Engineered to Work Together