7 Replies Latest reply on Sep 28, 2006 5:08 AM by jactor

    Multiple depends

      I am trying to develop a service which is using a stateless session bean (EJB3). So I am dependent of this bean, but this bean is dependent on a persistence unit which seems to be deployed.

      ObjectName: jboss.j2ee:jar=concept.jar,name=EntityServiceBean,service=EJB3
       State: NOTYETINSTALLED
       I Depend On:
       persistence.units:unitName=proof
      


      Even though this ejb is dependent on a persistence unit, it's visible as a service in the jmx console. This result in my service being started but it is unable to look up the ejb as this needs the persistence context.

      I would like my service to be dependent on the persistence unit as well so that it would not get started without its resources available. How do I say that an MBean is dependent on several other beans?

      In my jboss-service.xml; do I use several depends-tags, list then in a comma seperated way inside the tag, or something else?

        • 1. Re: Multiple depends

          ... I had a typo...

          this bean is dependent on a persistence unit which seems NOT to be deployed.


          • 2. Re: Multiple depends

            I discovered that when I restart the server and I have the MBean in the deploy folder, the MBean gets deployd right away without waiting for any depends to be deployed. What am I doing wrong? Here is the jboss-service.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <server>
             <mbean code="concept.jmx.Checker" name="concept:jmx=concept.jmx.Checker">
             </mbean>
             <depends>
             jboss.j2ee:jar=concept.jar,name=EntityServiceBean,service=EJB3
             </depends>
             <depends>persistence.units:unitName=proof</depends>
            </server>


            • 3. Re: Multiple depends
              mtb2ride

              What version of JBoss are you using? I have a similar problem with 4.0.4.GA.

              http://jboss.org/index.html?module=bb&op=viewtopic&t=91443

              • 4. Re: Multiple depends

                Thanx for this solution! I will try it on my beans. I am using jboss-4.0.4.GA as well so I hope this will fix my problem!!!

                • 5. Re: Multiple depends

                  I am sorry. It seemed like the solution, but the MBean are still started...

                  My jboss-service.xml:

                  <server>
                   <mbean code="concept.jmx.Checker" name="concept:jmx=concept.jmx.Checker">
                   </mbean>
                   <depends-list>
                   <depends>
                   jboss.j2ee:jar=concept.jar,name=EntityServiceBean,service=EJB3
                   </depends>
                   <depends>persistence.units:unitName=proof</depends>
                   </depends-list>
                  </server>
                  


                  • 6. Re: Multiple depends
                    mtb2ride

                    Your depends-list is setup wrong, use

                    <depends-list-element>


                    • 7. Re: Multiple depends

                      Thanx a billion!!!