Every EJB class file has —

2018

Every EJB class file has —

  1. A.

    one accompanying interface and one XML file

  2. B.

    one accompanying interface and two XML files

  3. C.

    two accompanying interfaces and one XML file

  4. D.

    two accompanying interfaces and two XML files

Attempted by 234 students.

Show answer & explanation

Correct answer: C

Answer: two accompanying interfaces and one XML file

Explanation:

  • Two interfaces: Historically an EJB class has a pair of interfaces that expose its client view and lifecycle operations (for example, a home interface together with a remote interface, or the local equivalents).

  • One XML file: The deployment descriptor (typically ejb-jar.xml) describes deployment settings for the bean; this is the single XML file associated with the EJB class.

  • Version note: In EJB 3.x and later, annotations can replace or reduce the need for ejb-jar.xml, and the separate home interface was removed. As a result, some modern beans expose a single business interface or use a no-interface view.

Summary: The traditional/expected answer is two interfaces plus one deployment descriptor XML; modern EJB versions may alter this structure via annotations.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Up Lt Grade Assistant Teacher 2025