Assume that the EJB remote component interface does NOT throw any application specific exceptions which two additional exceptions does this code need to handle? 1.java.ejb.EJBException 2.java.rmi.RemoteException 3.javax.ejb.RemoveException 4.javax.ejb.FinderException
First of all, answer 1 is NOT correct. EJBException is an unchecked exception, so there's no need to handle it. 2 is correct, because all methods may throw such an exception. 3 is correct, it may be thrown from the remove method (Session and Entity beans) 4 is incorrect, it's only for finder methods.
I was thinking from the container's perspective ...
yeah, since the RemoveException is checked exception, it would have to be caught by the client ... this would be compile-time check and the client would not compile at all if you don't catch the RemoveException
But, for SLSB can there be a scenario in which the RemoveException would actually be thrown back to the client?