1 Reply Latest reply on Jan 22, 2004 5:38 PM by Darran Lofthouse

    Explanation of local JNDI name

    natebowler Newbie


      "natebowler" wrote:
      I can access a Local inteface on a Test EJB (stateless session) with the following DD and JSP code.

      +------<ejb classes>

      Contents of ejb-jar.xml:

      <session >
      <display-name>Test Methods Bean</display-name>

      Contents of web.xml - nothing ejb-related (ejb-link, etc.)

      Contents of test.jsp

      Properties props = System.getProperties();
      InitialContext iniCtx = new InitialContext(props);
      Object obj = iniCtx.lookup("local/TestMethods");
      TestMethodsLocalHome home = (TestMethodsLocalHome) PortableRemoteObject.narrow(obj, TestMethodsLocalHome.class);
      TestMethodsLocal test = home.create();
      String echo = test.echo("WOo Hoo");

      My question is: How did this become "local/TestMethods"?

      The only way I found this is by removing the Remote interfaces and DD and looking in the logs for the deployed EJB/JNDI name on an only-local EJB.

      If I have both remote and local, I only see "TestMethods" in the logs. However, "TestMethods" can be used to get remote Home and "local/TestMethods" can be used to get local Home.

      Where is this documented? Is this a J2EE standard and implicit, or is this a JBoss-specific naming? If JBoss-specific, can this be changed?