EJB‎ > ‎

JNDI

To find JNDI names of your EJB with Jboss,
  1. browse to http://<IP>:8080/jmx-console/
  2. Under Jboss section, click on "service=JNDIView"
  3. Click invoke under "java.lang.String list()"
  4. Under "Global JNDI Namespace" you should have your namespace tree.
To talk to a local interface of the following Bean:

MyProject
    +-MyBean
        +-local
        +-remote

        
So this EJB is injected like this:

@EJB(mappedName="MyProject/MyBean/local")
MyBeanLocal mbl;


Using context lookup:

initCtx = new InitialContext();
mbl = (MyBeanLocal)initCtx.lookup("MyProject/MyBean/local");





Comments