Oracle
1Z0-895 · Question #9
A developer writes a stateless session bean HelloBean that exposes a local business interface Hello: The developer wants to test HelloBean using the EJB 3.1 Embeddable API. Given a main method with…
The correct answer is B. InitialContext ic = new InitialContext(). You can initialize the InitialContext class to obtain a context, that can further be used to perform
Server Installation and Configuration
Question
A developer writes a stateless session bean HelloBean that exposes a local business interface Hello: The developer wants to test HelloBean using the EJB 3.1 Embeddable API. Given a main method with the following code: 100. EJBContainer container = EJBContainer.createEJBContainer(); Assuming HelloBean is packaged in hello.jar and included in the classpath, which code correctly acquires a reference to HelloBean?
Exhibit
Options
- AInitialContext ic = new InitialContext();
- BInitialContext ic = new InitialContext();
- CContext c = container.getContext();
- DContext c = container.getContext();
How the community answered
(48 responses)- A13% (6)
- B77% (37)
- C2% (1)
- D8% (4)
Explanation
You can initialize the InitialContext class to obtain a context, that can further be used to perform
Topics
#EJB Embeddable API#EJBContainer#InitialContext#JNDI lookup
Community Discussion
No community discussion yet for this question.
