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

    EJB jndi-name lookup and naming problem

    Eric Chow Apprentice


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

      <resource-managers />





      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,