Exit 1Z0-895 Java EE 6 Enterprise JavaBeans Developer Certified Expert
Question 2 of 5
0% complete
Q2 Single choice

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?

  • A

    InitialContext ic = new InitialContext();
    Hello h = (Hello) ic.lookup("java:global/hello/HelloBean");

  • B

    InitialContext ic = new InitialContext();
    Hello h = (Hello) ic.lookup("com.acme.Hello");

  • C

    Context c = container.getContext();
    Hello h = (Hello) ic.lookup("com.acme.Hello");

  • D

    Context c = container.getContext();
    Hello h = (Hello) ic.lookup("java:global/hello/HelloBean");