A developer writes a stateful session bean with local business interface Bar containing method
test. Method test is implemented as:
11. @Remove
12. public void test () {}
A business method in a stateless session bean invokes a reference to bean Bar as follows:
11. @EJB Bar bar;
12.
13. public void foo () {
14. bar.test ();
15. bar.test();
16. }
Assuming execution reaches Line 15, what is the expected result?
A.
Method foo returns without error.
B.
A javax.ejb.NoSuchEJBException is thrown.
C.
A java.rmi.NoSuchObjectException is thrown.
D.
A javax.ejb.NoSuchEntityException is thrown.
A NoSuchEJBException is thrown if an attempt is made to invoke a business method on a stateful session or singleton object that no longer exists.
https://docs.oracle.com/javaee/6/api/javax/ejb/Remove.html
But you do invoke method on the stateful session bean, so correct answer is A.
Sorry, correct is B.