I have a problem with the LocateRegistry.createRegistry(int port) method.
The problem is that there can be only one RMI registry created in a Vitrual Machine. (this is a limitation to the concept of RMI).
Since RMI needs to have a few objects with a known Object ID for allowing clients to find the Registry, these can not exist multiple times in the same VM.
What you can do is start one RMI registry from within your application with LocateRegistry.createRegistry, and start one or more other RMI registries externally (on the command prompt with 'rmiregistry').