3 Replies Latest reply on Apr 7, 2004 9:47 AM by adrian.brock

    env not bound

    adrianw

      Hello!

      I'm launching an EJB from dispatcher, but at runtime I obtain a NamingException error:

      env not bound

      My source code is something like that:

      InitialContext ic = new InitialContext();
      Object objRef = ic.lookup ("java:comp/env/ejb/myEJB");

      Somebody knows how I can solve it? Why MBean can`t locate "env"?

      Thanks

        • 1. Re: env not bound

          MBeans don't have an ENC (enterprise naming context)
          you need to look it up in global jndi.

          Regards,
          Adrian

          • 2. Re: env not bound
            adrianw

            I'm sure this question is a bit silly, but... How can I look up the ENC in global jndi? There's anywhere a good tutorial about this?

            Thanks

            • 3. Re: env not bound

              By "it" I meant the ejb.
              It is deployed at <ejb-name> by default or if you want the local home it
              is local/<ejb-name> unless you change it in jboss.xml

              ENCs are special contexts only valid inside an EJB bean or web application.

              Regards,
              Adrian