Object foo = remoteLoader.loadClass("Foo").newInstance();
RMID.removeLog();
RMID rmid = RMID.createRMID();
rmid.start();
try {
RemoteObject stub = (RemoteObject)
LocateRegistry.getRegistry(ActivationSystem.SYSTEM_PORT);
Method method =
Registry.class.getMethod("lookup", new Class[]{String.class});
RemoteRef ref = stub.getRef();
try {
// call lookup() on the registry ref with a Foo
ref.invoke(stub, method, new Object[]{foo}, LOOKUP);
throw new RuntimeException("lookup did not fail");
} catch (ServerException e) {