2 Replies Latest reply on Feb 14, 2008 5:17 AM by Andrew Rubinger

    EJB Local Home in EJB 3.0

    Gupta Kancharla Newbie

      Is JBoss supports LocalHome? I am not able to lookup from the JSF backing bean which is also in the same ear file.

      I have created an Stateful Session Bean as follows

      public class TestUserBean implements TestUserLocal {
      public void initDefault(){


      My ear package is as follows.
      |____ entities.jar
      |____ ejb-beans.jar
      |____ webapp.war
      |____ META-INF
      |____ application.xml

      I need to lookup the TestUserHome which is in ejb-beans.jar from my JSF backing bean which is webapp.war. I tried the following ways to lookup none of them successful.

      a) TestUserBean/localhome
      b) TestUserBean/home
      c) ejb-beans.jar#TestUserBean/home
      d) Define in web.xml as follows


      and in jboss-web.xml

      e) TestUserHome.class.getName();

      Please suggest me how to lookup LocalHome. I am using jboss-4.2.2.GA

      Thank you,

        • 1. Re: EJB Local Home in EJB 3.0
          Arbi Sookazian Master

          We are using Seam 2.0 with JBoss 4.2.1.GA. In EJB3 session beans, you only need a local interface and the SFSB/SLSB implementation class.

          There is no need for LocalHome interface with EJB3 as far as I know.


          @Name("orderAction") //@Name is Seam specific annotation
          public class OrderAction implements OrderActionLocal
          public interface OrderActionLocal

          Via JSF EL, we execute public methods that are defined in both the interface and class above:
          <h:commandButton id="update"
           action="#{orderAction.updateOrder}" />

          The EJB3 expert group is planning on eliminated the local interface for session beans in the 3.1 spec. http://bill.burkecentral.com/category/ejb-31/ They have already been eliminated local and remote for entity beans (JPA entities) in EJB3.

          JSR220 - EJBCORE:

          section 3.6.3

          This was the only way of providing a local client view in EJB 2.1 and earlier releases. The local client view provided by the business interface in EJB 3.0 as described in Section 3.4 is now to be preferred.

          section 3.4

          The EJB 3.0 local or remote client of a session bean written to the EJB 3.0 API accesses a session bean through its business interface. The business interface of an EJB 3.0 session bean is an ordinary Java interface, regardless of whether local or remote access is provided for the bean.

          Hope that helps!

          • 2. Re: EJB Local Home in EJB 3.0
            Andrew Rubinger Master

            Yes, the EJB 3.0 specification supports 2.1 Views for interop / backwards-compat, and JBoss EJB3 implements this.

            Sounds like you're just not finding the Home in JNDI. Use the JNDI Viewer in the JMX Console:


            If you don't see an object implementing LocalHome defined, we might have to take a look at how you're declaring your 2.1 View. Should just be:

            public class MyBean implements MyLocalInterface{...}

            public interface MyLocalHome extends EJBLocalHome{...}