1 Reply Latest reply on Feb 6, 2002 4:23 PM by saylor09

    local ref/link to ejb in seperate jar in the same ear

    saylor09

      Is it possible to define an ejb-local-ref to a bean in a different jar file that is within the same ear? I haven't found any clear cut answer to this. I've been trying to get this to work without success. Here's what I have:

      JBoss3.0 alpha - updated source 02/05/2002


      ProductEJB.jar ejb-jar.xml
      =============================
      <ejb-jar>
      <enterprise-beans>

      <ejb-name>Product</ejb-name>
      <local-home>ProductLocalHome</local-home>
      ProductLocal
      <ejb-class>ProductEJB</ejb-class>
      (...)

      </enterprise-beans>
      </ejb-jar>
      =============================



      AccountEJB.jar ejb-jar.xml
      ===============================
      <ejb-jar>
      <enterprise-beans>

      <ejb-name>Account</ejb-name>
      (...)
      <ejb-local-ref>
      <ejb-ref-name>Product</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>ProductLocalHome</local-home>
      ProductLocal
      <ejb-link>Product</ejb-link>
      </ejb-local-ref>

      </enterprise-beans>
      </ejb-jar>
      ===============================

      When I deploy the ear containing these jar files, the ProductEJB.jar file is successfully deployed but I get a DeploymentException for AccountEJB.jar stating that "Bean Product not found within this application." This sounds like "this application" is the jar file and not the enclosing application archive.

      Do I have to put these beans into the same jar file? If so, is this how it is intended to work under the production release of JBoss? If not, what am I missing?

      Thanks

      Scott

        • 1. Re: local ref/link to ejb in seperate jar in the same ear
          saylor09

          Well, according to the spec and notes in the ejb-jar.dtd, this should be possible by using the following kind of notation:

          <ejb-link>../productEJB.jar#Product</ejb-link>

          I've tried several variations on this without success. I haven't found any definitive answer to this in the JBoss docs or in the forums. I've also attempted to define an ejb-ref in jboss.xml, but it doesn't seem to work for ejb-local-refs.

          I'm still a beginner when it comes to EJBs and JBoss so I'm probably missing something. But so far, I'm assuming that in JBoss any ejb-local-ref needs to point to an EJB in the same jar file. I suppose I'll just have to resolve to using the global jndi name?

          Can anyone at least confirm this?