RMI Server Randomly Terminating
Hello,
I am running the following code:
Code:
public class StartServer
{
public static void main(String[] args)
{
try {
Registry registry = LocateRegistry.createRegistry(1099);
RMIServerMethods serverStub = (RMIServerMethods) UnicastRemoteObject.exportObject(new Server(), 0);
registry.rebind("rmiservermethods", serverStub);
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
After running this the process will terminate (including all of the threads within it) w/o any exceptions after a random amount of time. This happens about 50-60% of the time which means that it does often work. I have tried to start the rmiregistry separately without any success. Has anyone experienced this issue? If so, are you aware of a fix?
Thanks!