I am writing a very simple RMI server, and I am seeing intermittent java.rmi.NoSuchObjectExceptions in the unit tests.
I have a string of remote method
there is one point missing in the above discussion. There is something that is called distributed garbage collection (DGC). If there are no living local and remote references to a distributed object the GC is allowed to remove the object from memory. There is a sophisticated algorithm to verify this. The nice code snippet from above is indeed a good demonstration of the effectiveness of the DGC.
What somehow looks like a feature is nothing but the designed behavior!
Frank