test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.java
Print this page
@@ -62,12 +62,13 @@
if (args.length >= 1)
protocol = args[0];
System.out.println("EchoServer: creating remote object");
EchoImpl impl = new EchoImpl(protocol);
+ int registryPort = new Integer(System.getProperty("rmi.registry.port"));
System.out.println("EchoServer: binding in registry");
- Naming.rebind("//:" + TestLibrary.REGISTRY_PORT +
+ Naming.rebind("//:" + registryPort +
"/EchoServer", impl);
System.out.println("EchoServer ready.");
} catch (Exception e) {
System.err.println("EXCEPTION OCCURRED:");
e.printStackTrace();