Hi Ramses,
You could also try turning RMI debugging on (see the Useful java.rmi and sun.rmi Properties on the
Sun RMI Home page). Then see if the registry gives any information about why it is not unbinding the instance.
Ahhh, the light dawns. This is not a problem with your unbind. For a start, calling rebind() will not warn you about an existing object being bound - it just overwrites it. If you use bind, and the object already exists, then you get a totally different exception:
java.rmi.AlreadyBoundException.
The exception you are getting is the one you get when you try to start the registry a second time. If you do that, then you get an stack trace similar to:
See that second last line? The one that has the "LocateRegistry.createRegistry" in it? Do you get that? If not, please post your entire stack trace.
Regards, Andrew