Multiple choice technology programming languages

When a remote client invokes a method on an entity bean using container managed persistence, and that bean has already been removed, what exception will be thrown?

  1. javax.ejb.AccessLocalException

  2. javax.rmi.NoSuchObjectException

  3. javax.ejb.NoSuchEntityException

  4. javax.rmi.StubNotFoundException

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When a remote client invokes a method on an entity bean that has been removed, the container throws javax.rmi.NoSuchObjectException. This differs from local client views (which throw NoSuchObjectLocalException) and is specifically for RMI-based remote invocations. The exception indicates the referenced EJB object no longer exists.