Multiple choice technology programming languages

Which of the following statements show what happens when a client invokes a session bean instance that does not exist?

  1. javax.ejb.NoSuchObjectLocalException for the local client

  2. javax.ejb.NoSuchObjectException for the remote client

  3. javax.ejb.RemoveException

  4. javax.ejb.ObjectNotFoundException

  5. java.rmi.NoSuchObjectException for the remote client

Reveal answer Fill a bubble to check yourself
A,E Correct answer
Explanation

When a client invokes a session bean that no longer exists, the exception depends on the client type. Local clients receive javax.ejb.NoSuchObjectLocalException. Remote clients receive java.rmi.NoSuchObjectException (a RemoteException subtype). Option B's NoSuchObjectException and Option C's RemoveException are incorrect exception types. Option D's ObjectNotFoundException is typically for database operations, not EJB invocations.