If a client makes a call to a stateful session or entity object that has been removed, the container should throw the java.rmi.NoSuchObjectException (which is a subclass of java.rmi.RemoteException) to a remote client
As it is not guaranteed that NoSuchObjectException will be thrown, the answer in the book is correct.
Roger, could you please note the page in the spec since I can not find that formulation you just gave.
The only thing I can find is on pg. 379 (18.3.5), which says:
if a client makes a call to a session object that has been removed the container should throw the java.rmi.NoSuchObjectException ...
But it doesn't say that by default it throws a java.rmi.RemoteException, and that would be better to ("should") throw a NoSuchObjectException. Wheras in section 18.3.4 the distinction between what the container has to do and what it should do is clearly highlighted.
RemoteException is always thrown to a remote client, the spec is encouraging - but not requiring - the container to be helpful to the client by throwing a subclass (NoSuchObjectException) in some cases. As NoSuchObjectException or RemoteException will be thrown, the book's answer is correct.
The same principle applies for both local and remote clients. If a local client makes a call to a session object that has been removed, the Container should throw javax.ejb.NoSuchObjectLocalException or javax.ejb.EJBException to the client. You therefore must code your local client to handle both exceptions.