2 Replies Latest reply on Apr 20, 2002 6:11 PM by jcasp

    local ejb refs and separate jars

    jcasp

      Hello,
      I've been researching my problem on this message board for a while, but haven't managed to find a situation similar to my own.

      I have an entity bean (call it MyBean) that is packaged in it's own jarfile (MyBean.jar) and provides a local interface used by a session facade bean (call it MyBeanManager) that is also in it's own jarfile. The deployment descriptor of the session bean contains an <ejb-local-ref> to the MyBean entity bean, as per the example listed in this thread:
      http://main.jboss.org/forums/thread.jsp?forum=47&thread=1450&message=5864&q=ejb-ref+local#5864

      The MyBeanManager jarfile contains the Local & LocalHome interface classes for MyBean.

      I think my problem may be due to JBoss's concept of internal and external EJB references. Apparantly, I need to use an external reference for any bean not packaged in the same jarfile as the caller bean, even though the two beans are packaged in the same ear file.
      Is this true?
      Am I allowed to use local ejb references to beans packaged in this manner, or does JBoss require them to be packaged in the same jarfile?

      This doesn't seem to work, as JBoss 3.0beta complains with:
      org.jboss.deployment.DeploymentException: Bean MyBean not found within this application.

      When I used the Sun Deploytool to construct the deployment descriptor for the MyBeanManager bean, it made a local reference to my entity bean using the <ejb-link> tag but prepended the jarfile of the entity bean followed by a hash character:
      <ejb-local-ref>
      ...
      <ejb-link>MyBean.jar#MyBean</ejb-link>
      </ejb-local-ref>

      This did not work either. I'm assuming this 'JarName#BeanName' is a Sun RI-specific syntax?

      Any advice for dealing with this situation? I'd like to keep the beans packaged independently if possible, as I believe it makes for cleaner distribution & reuse.

      I'm relatively new to J2EE, in particular JBoss, so I apologize in advance for stupid questions!
      Thank you very much.
      Justin