When i shutdown the RMI server program by using,
serverReg.unbind("LibraryServer"); it only remove the bound of remote object and it's key 'LibraryServer. If i start the server same time it give me an exception ObjID already in use. How can i entirety remove remote object from the registry ?.
Binding statement of Remote object and it's key is,
serverReg.rebind("LibraryServer", new RemoteFactoryImpl());
Correct.
I'd like to see that exception and stack trace.
You have already done so. You may be looking for a way to unexport the remote object, which is given by
UnicastRemoteObject.unexportObject().However the
ObjID already in useerror can realistically only be coming from trying to export another Registry from a JVM in which you have already exported one. Which doesn't correspond with your description at all.