1 Reply Latest reply on Dec 14, 2003 1:39 AM by Juha Lindfors

    java:comp/env/MyEjbName  Vs local/MyEjbName

    Naseeruddin Mohammad Newbie

      I find using local/MyEjbName more powerfull then using java:comp/env/MyEjbName. Powerful in the sence, i never had problems like ejb not bound or NameNotFound Exceptions with local/EjbName.
      On the other hand if i used java:comp format i would not be able to lookup the beans sometimes. So i started to use local/ format in my applicatioon.

      Would that coz any problem to me; i am not planning to switch my app server from jboss.
      I also want to know why is local/ so powerful.


        • 1. Re: java:comp/env/MyEjbName  Vs local/MyEjbName

          The only difference is if you ever decide to change the name of the EJB jndi binding you're looking up, or want to later lookup a proxy with different interceptor stack and make this change transparently to your code or not.

          If you lookup directly from the JNDI context, a change like the above forces you to change and recompile your code. Using the bean's private ENC requires only a change of the deployment descriptor.