2 Replies Latest reply on Oct 6, 2006 10:11 AM by bill.burke

    SLBs cyclic dependencies

    yandosh

      I would like to ask a question about cyclic dependencies between EJB. I have 3 stateless EJBs: A depends on B, B depends on C, C depends on A. EJBs refuse to deploy due to MBeans waiting for other MBeans error.
      My question is: Is there really any kind of limitation of cyclic dependencies between stateless session beans? If there is why and is there any "workaround" to make the EJBs deploy? Thanks in advance.

      Frantisek Jandos

        • 1. Re: SLBs cyclic dependencies
          bill.burke

          Yes, use the @org.jboss.annotation.IgnoreDependency annotation. THere is also an XML equivalent

          i.e.

          
          @EJB @IgnoreDependency MyEJB ref;
          
          or
          
          jboss.xml
          
          <jboss>
           <enterprise-beans>
           <session>
           <ejb-name>Session2Bean</ejb-name>
           <ejb-ref>
           <ejb-ref-name>session1</ejb-ref-name>
           <ignore-dependency/>
           </ejb-ref>
           </session>
           </enterprise-beans>
          </jboss>
          



          • 2. Re: SLBs cyclic dependencies
            bill.burke

            use @IgnoreDependency to break the cyclic chain.