5 Replies Latest reply on Dec 11, 2001 8:59 AM by Alex Pavlov

    what JNDI mapping is appliead to Local interfaces?

    Ignacio Newbie

      Hi, I am deploying a ear with some beans. As far as they are remote, no problem. They can be accesed with 'lookup(BeanName)', or 'lookup("java:comp/env/BeanName")'.

      But when the bean has only Local and HomeLocal interfaces the default JNDI mapping changes (but shouldn't, according to the EJB 2.0 spec). Where is it being registered? The log says something about local/BeanName, but doesn't work either.

        • 1. Re: what JNDI mapping is appliead to Local interfaces?
          NiC Newbie

          Hi,

          I have the same problem.
          Is there something we have missed in the jboss
          configuration to make local interfaces work ?

          Anyone who has figured this out ?

          Regards

          /NiC

          • 2. Re: what JNDI mapping is appliead to Local interfaces?
            Ignacio Newbie

            Sorry, I finally did (and forgot to post it :)

            Local interfaces are registered in local/BeanName. You have to remember the standard way to call them (no PortableRemoteObject.narrow call) and, my fault, that Collection of these ARE NOT SERIALIZABLE (that is, you cannot return these from a call to a remote EJB, and have to use Object Values or similar). If you implement exactly the same example as in the "Professional EJB" chapter that is available in theserverside.com, everything works.

            • 3. Re: what JNDI mapping is appliead to Local interfaces?
              tom adler Newbie

              What version of JBoss supports local interfaces?

              • 4. Re: what JNDI mapping is appliead to Local interfaces?
                Henri Chen Newbie

                > Sorry, I finally did (and forgot to post it :)
                >
                > Local interfaces are registered in local/BeanName.
                Did you make it work on the 2.4.3? I have tried to look up it by given "local/BeanName" but only get an "local not bound" Exception?

                Would you please give an working example?

                Henri

                • 5. Re: what JNDI mapping is appliead to Local interfaces?
                  Alex Pavlov Newbie

                  In order to use local interfaces you have to add next section in deployment descriptor for your EJB:


                  <ejb-name>Bean0</ejb-name>
                  ejb.interfaces.BeanHome
                  ejb.interfaces.Bean
                  <local-home>ejb.interfaces.LocalBeanHome</local-home>
                  ejb.interfaces.LocalBean

                  <ejb-class>ejb.session.PSBean</ejb-class>
                  <session-type>Stateless</session-type>
                  <transaction-type>Container</transaction-type>
                  You can refer to this EJB from other beans by adding ejb-local-ref to corresponding descriptor:

                  <ejb-local-ref>
                  <ejb-ref-name>local/Bean0</ejb-ref-name>
                  <ejb-ref-type>Session</ejb-ref-type>
                  <local-home>ejb.interfaces.LocalBeanHome</local-home>
                  ejb.interfaces.LocalBean
                  <ejb-link>Bean0</ejb-link>
                  </ejb-local-ref>


                  and, of course you have to implement javax.ejb.EJBLocalObject and javax.ejb.EJBLocalHome in yours remote and home interface respectively.

                  Alex.