Java : JNDI binding in JBoss 5

This page last changed on Apr 07, 2009 by Kees de Kooter

JNDI Bindings

By default, session beans will bind to JNDI in the form ejbName/remote for remote interfaces and ejbName/localin the case of local interfaces. When the EJBs are deployed in an .ear file, the default jndi binding will be prepended by the name of the .ear file. So if the ear file name is foo.ear the default jndi names would be foo/EJB-NAME/remote and foo/EJB-NAME/local. You can override this behavior by defining your own @org.jboss.ejb3.LocalBinding or @org.jboss.ejb3.remoting.RemoteBinding.

Local Interface JNDI Binding.

To change the JNDI name for your local interface use the org.jboss.ejb3.LocalBinding annotation.@Stateless @LocalBinding(jndiBinding="custom/Session") public class SessionBean implements Session { }

Remote Interface JNDI Binding

To change the JNDI name for your remote interface use the org.jboss.ejb3.RemoteBindings annotation.@Stateless @RemoteBinding(jndiBinding="custom/remote/Session") public class SessionBean implements Session { }

Browsing actual JNDI bindings

In the jmx-console find the MBean named "service=JNDIView", open it and invoke the list operation.

Reference