Why am I getting a NoSuchObjectException (or similar RMI exception)?
This most likely means that the RemoteStream client is trying to use a reference to a RemoteStreamServer which has not been serialized (in other words, the client is trying to use a local handle to the server). RMI uses a distributed garbage-collection (DGC) strategy to keep server references alive while clients have RemoteStub instances that reference them. If the RemoteStub is not been serialized/deserialized before usage, it does not trigger the DGC code, so the server instance gets cleaned up soon after creation. Basically, you should never use a RemoteStreamServer reference locally (you should just use a regular Input/OutputStream in this case). For more information, see the EJB section of the Usage Notes.