[jboss-user] [EJB 3.0] - Re: Programmatically determining ear name for JNDI lookups:

waynebaylor do-not-reply at jboss.com
Fri Sep 14 10:00:22 EDT 2007


i would recommend that you not include the EAR name at all in your JNDI names. for example, if you have the bean class:


  | @Stateless
  | @Local(com.mycomp.MyLocal.class)
  | @Remote(com.mycomp.MyRemote.class)
  | public class MyBean implements MyLocal, MyRemote
  | {
  |     ...
  | }
  | 
then you should bind its interfaces to meaningful JNDI names (the EAR name can be changed by anyone so it's not meaningful):


  | @Stateless
  | @Local(com.mycomp.MyLocal.class)
  | @Remote(com.mycomp.MyRemote.class)
  | @LocalBinding(jndiBinding="com.mycomp.MyLocal")
  | @RemoteBinding(jndiBinding="com.mycomp.MyRemote")
  | public class MyBean implements MyLocal, MyRemote
  | {
  |     ...
  | }
  | 

As for the multiple EARs part:
1) If you're including it in multiple EARs which will be deployed on the same  App. Server, then you will need to include some Class Loading Isolation. You can continue to customize the JNDI name with your config file (i just wouldn't use the EAR name as part of it).
  | 
  | 2) If the EARs won't be deployed on the same App. Server, then you won't need the config file anymore.

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

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



More information about the jboss-user mailing list