0 Replies Latest reply on Jan 12, 2005 7:37 PM by johnv

    Why is my <jndi-name> not recognized?

    johnv

      I'm doing a JNDI lookup via:

      Object homeObj = ctx.lookup("ejb/foo/FooHome");

      The jboss.xml has:


      <ejb-name>Foo</ejb-name>
      <jndi-name>ejb/foo/FooHome</jndi-name>


      When I run the program which does the lookup I get the exception:

      javax.naming.NameNotFoundException: ejb not bound

      If I look at this bean in the JBoss Web Console it indicates:

      Foo (JNDI: Foo)

      which would seem to indicate that its using the ejb-name for the JNDI name and not respecting the explicit jndi-name in jboss.xml.

      I could probably resolve this by changing my lookup to:

      Object homeObj = ctx.lookup("Foo");

      but that's not solving the root of the issue and it would require many edits to many EJBs in my deployment descriptor which all use the:

      <jndi-name>ejb/foo/</jndi-name>

      I'd rather fix it the right way and leave my descriptor alone.