0 Replies Latest reply on Aug 10, 2005 4:48 AM by jaikiran pai

    Local reference declarations in ejb-jar.xml

    jaikiran pai Master

      Hi,
      I have the following declaration in a ejb-jar.xml:
      What exactly does this mean(the statements in bold)?

      <session >
       .....
       <ejb-name>MyTestManagerBean</ejb-name>
      
       <home>...</home>
       <remote>...</remote>
       <ejb-class>...</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/SequenceGenerator</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>...</local-home>
       <local>...</local>
       <ejb-link>SequenceGeneratorBean</ejb-link>
       </ejb-local-ref>
      
       <resource-ref >
       <res-ref-name>jdbc/myDS</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       <res-sharing-scope>Shareable</res-sharing-scope>
       </resource-ref>
       </session>


      As per my understanding, it creates a logical reference for a bean to be referred by some other bean. Is this right?

      When is the logical name actually created during startup of server? i.e. When is the SequenceGeneratorBean bound to ejb/SequenceGenerator.
      I am enquiring about this since, i have a startup class implemented using a mbean, which actually looks up a bean. The bean (say xyzBean) looks up the MyTestManagerBean. I get the following exception:

      /ejb not bound


      If i remove the ejb-local-ref from the ejb-jar, then everything works fine.

      So how do i specify a dependency in my mbean for this local reference.

      Any suggestions are appreciated.

      Thank you