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

    local ejb refs and separate jars

    justin Newbie

      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:

      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:

      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.