4 Replies Latest reply on Feb 17, 2010 9:57 AM by andy.miller

    Bi-directional dependency between two stateless session beans

    andy.miller

      I was updating an application that has many stateless session beans, and in adding some functionality, I have the following situation:

       

      @Stateless

      public class SupplierManagerBean implements SupplierManager {

       

           @EJB

           private ProductManager productManager;

       

      ...

       

       

      @Stateless

      public class ProductManagerBean implements ProductManager {

       

          @EJB

          private SupplierManager supplierManager;

       

      ...

       

       

      So, this compiles just fine, but will not deploy cleanly.  The profile service says it fails, and says to look at previous errors of which there are none.  Then the in the summary of incomplete deployments you get an error about the state of the SupplierManagerBean, and that its missing a dependency on the ProductManagerBean, and of course the ProductManagerBean says its missing a dependency on the SupplierManagerBean.

       

      So, its obvious that the deployer cannot handle this situation, but the question is should it be able to?  I cannot find information that says whether this is something that should be supported or not.