nerdexam
Oracle

1Z0-860 · Question #11

OldBarBean is a stateless session bean written to the EJB 2.1 API with remote home interface. OldBarHome and remote component interface OldBar. FooBean is a stateless session bean written to the EJB 3

The correct answer is C. @EJB private OldBarHome OldBarHome;. See the full explanation below for the reasoning.

Question

OldBarBean is a stateless session bean written to the EJB 2.1 API with remote home interface. OldBarHome and remote component interface OldBar. FooBean is a stateless session bean written to the EJB 3.0 API. OldBarBean and FooBean are the only EJBs packaged in the ejb-jar. The FooBean portion of the ejb-jar. xml also declares an ejb-ref whose ejb-ref-name is ejb/oldBar. The ejb-ref is linked to OldBarBean. There are no other ejb dependencies defined. A business method foo in FooBean needs to access OldBarBean. Which is portable code to achieve this goal?

Options

  • A©Remote
  • Bpublic void fooQ {
  • C@EJB private OldBarHome OldBarHome;
  • Dpublic void fooQ {

How the community answered

(44 responses)
  • A
    7% (3)
  • B
    5% (2)
  • C
    75% (33)
  • D
    14% (6)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice