2 Replies Latest reply on Jun 6, 2005 12:04 PM by zurchman

    Can an MBean use an EJB local interface?

    zurchman

      Can an MBean in an application access an EJB local interface?

      +- app.ear
      | +- app.jar
      | +- service.sar

      In this case, the MBean is located in service.sar, and the EJB's, which are also used by the application, are packaged in app.jar.

      The MBean calls a helper class that is also packaged in app.jar.

      Is it possible to define an ejb-local-ref in this case, or am I stuck with having to use the remote interface?

      [I know it's ancient history, but] This worked in 3.2.2.


        • 1. Re: Can an MBean use an EJB local interface?
          starksm64

          In general this cannot be done across all app servers as the only way to use an ejb-link from one component to another in an ejb jar or war in an ear. JBoss does happen to bind its local homes into jndi such that they can be accessed. See the following wiki and look at the local-jndi-name discussion in the "Why is there a "@xxxxxx" in my local ejb JNDI name?" section.

          • 2. Re: Can an MBean use an EJB local interface?
            zurchman

            Thanks, Scott

            Here's the wiki reference:

            http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIAccessALocalHome

            And from the relevant section:

            ...apps using lookups into the global jndi tree for local homes now have to specify the ejb-local-ref elements that should have been used all along, or use a local-jndi-name in the jboss.xml descriptor to provide a globally unique name for the local home binding. The use of the ejb-local-ref is the standard and portable solution.

            I'll use a local-jndi-name.