[jboss-dev-forums] [Design of EJB 3.0] - Re: jndi name issues

wolfc do-not-reply at jboss.com
Tue Apr 29 05:10:07 EDT 2008


It should work as follows:

By default beans are bound in JNDI in the form "", regardless which interfaces are defined on the bean.
Depending on whether an EJB3 deployment is packaged within an EAR the JNDI name will be prepended by the short name of the EAR. So for foo.ear/bar.jar/MyBean it will become "foo/MyBean".
The final JNDI name can be overriden with the use of @LocalBinding, @RemoteBinding or the equivalents from jboss.xml.

Whenever a lookup is performed on the final JNDI name a proxy is returned implemented all home and business interfaces. (1)
To get a specific interface proxy you should do a lookup on "<JNDI name>/", where "interface" can be any home or business interface. Or "interface" can be one of the following keywords: "home", "localHome", "local" or "remote" to specify the category.
If there are more business interfaces defined in one category, the returned proxy will implement all those interfaces.

(1) CAVEAT: In case of conflicting method signatures a call to that proxy might throw an UndeclaredThrowableException or behave differently than expected. The only solution is doing a finer grained lookup. (EJBTHREE-786 and EJBTHREE-1222)

For backwards compatibility: http://www.jboss.org/jbossejb3/docs/tutorial/jndibinding/jndi.html

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147455#4147455

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147455



More information about the jboss-dev-forums mailing list