I need to run rmiregistry automatically.. any one help me...

hi
I am new to RMI, i created a simple RMI concept and it is working fine. I need to start rmiregistry by manually. Is there way to run rmiregistry as automatic when i execute the server program..
please clear me..

To start the rmiregistry programmatically:
LocateRegistry.createRegistry(1099);To stop it programmatically:
UnicastRemoteObject.unexportObject(registry, true);However, you can also do it "dirty" (I tried this successfully):
Runtime.getRuntime().exec(rmiRegistry);
// rmiRegistry is e.g. ".../rmireghistry.exe"The benefit of the last method is that "rmiregistry" is its own process which you can monitor (e.g. TaskManager in Windows) and kill seperatly if necessary during debugging.

Similar Messages

Maybe you are looking for