nerdexam
Oracle

1Z0-895 · Question #69

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…

The correct answer is B. A javax.ejb.NoSuchEJBException is thrown. See the full explanation below for the reasoning.

Question

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?

Options

  • AMethod foo returns without error.
  • BA javax.ejb.NoSuchEJBException is thrown.
  • CA java.rmi.NoSuchObjectException is thrown.
  • DA javax.ejb.NoSuchEntityException is thrown.

How the community answered

(35 responses)
  • A
    6% (2)
  • B
    74% (26)
  • C
    17% (6)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice