4 Replies Latest reply on Dec 15, 2002 10:07 AM by cti_java

    Local Inerfaces

    davinci


      I am having problem looking up Beans through local interfaces in JBoss 3.0. What is the JNDI prefix for the
      local interfaces ?.

      Suppose I have a bean called “MyBean” and the corresponding ejb-jar.xml looks like

      <enterprise-beans>

      <!— I have left out some of the entries -->
      <ejb-name>My Bean</ejb-name>
      <local-home>LocaMyBeanHome</local-home>
      LocaMyBean
      <ejb-class>mypackage.MyBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <enterprise-beans>

      When I try to look up "MyBean" using

      new InitialContext().lookup("LocalMyBean");

      I get a "MyBean not bound" exception (NamingException).

      Do I need to tweak the jboss.xml (or any other files) to get local interfaces working ?.

        • 1. Re: Local Inerfaces
          lisegino

          Typo: Souldn't LocaMyBean be spelled "LocalMyBean"

          • 2. Re: Local Inerfaces
            davinci

            Yup! you are right. It was typo. But I did discover that
            jboss.dtd (3.0) has an element called
            <local-jndi-name/>. I am going to try specifying it
            and see what happens. Hope this should work.

            • 3. Re: Local Inerfaces
              davinci

              Yup!, you are right this is a typo. But I did discover that jboss.dtd has an element called <local-jndi-name/> that allows you to specify the jndi name of the local interface. I tried it and it works!!!.

              • 4. Re: Local Inerfaces
                cti_java

                I've tried your offer about the &lt;local-jndi-name/&gt; and as you said it works.

                But I do the lookup like that: ctx.lookup ("MyEjbName");
                and I want to it by:
                ctx.lookup ("java:/comp/env/ejb/MyEjbName"); and it doesn't work this way.

                What i'm missing??

                Thanks.