1 Reply Latest reply on Nov 14, 2002 3:16 PM by Juha Lindfors

    EJB jndi-name lookup and naming problem

    Eric Chow Apprentice

      Hello,

      My jboss.xml deployment descriptor is like following:
      ====================================================
      <?xml version="1.0"?>

      false
      <resource-managers />

      <enterprise-beans>

      <ejb-name>DBMessageEJB</ejb-name>
      <local-jndi-name>eric/DBMessage</local-jndi-name>

      </enterprise-beans>

      =========================================


      When I lookup the DBMessageEJB, I use the following statements:

      InitialContext jndiContext = new InitialContext();
      Object ref = jndiContext.lookup("eric/DBMessage");

      It's correct, right?


      But some times, I read some example. It will add "java:comp/env" or "java:/" in front of the jndi-name.

      But it failed to lookup when my statement was :
      Object ref = jndiContext.lookup("java:comp/env/eric/DBMessage");
      // Object ref = jndiContext.lookup("java:/eric/DBMessage"); =====> also not work


      // javax.naming.NameNotFoundException: eric not bound <<<<<< Exception



      Would you please to tell me how to use them and when?

      I am using JBoss 3.0.4 with JDK1.4.1 in M$-Windows environment.

      Best regards,
      Eric