RMI Registry leaves thread running
I've searched the postings about this topic and none of them have been helpful. I create an RMI registry at port 1099 in my app, use it, and then try to shut it down, but it leaves a thread running.
The following sample code shows what my code does (in a condensed form):
Registry registry = LocateRegistry.createRegistry(1099);
Communicator c =new CommunicatorImpl();
registry.rebind("//localhost/remoteserver", c );
Naming.rebind("rmi://localhost:1099/TriggerService", c);
registry.unbind("//localhost/remoteserver");
Naming.unbind("rmi://localhost:1099/TriggerService");
boolean b = UnicastRemoteObject.unexportObject(registry,true);
System.err.println("unexported: "+b );
When I run this code in Eclipse and the code exits, I still have a process running that was spawned by "LocateRegistry.createRegistry(1099)", but I can't figure out how to get a handle for it within my program, so that I can kill it. I've read that it will end when the JVM ends, but the RMI portion of my app is only a small part and I need the rest of it to keep running. Is there a way to stop this thread?
Thanks,
Tony

