5 Replies Latest reply on Jun 4, 2003 11:51 AM by adrian.brock

    How to configure an mbean dependency

    reitsma

      I am using 3.0.7 and have a sar with an ear embedded. Hot deployment is allright, but on startup of the server I get exceptions due to the missing datasource during the deployment of the entity beans.

      When I add an dependency to the conf/jboss-service.xml under the EJBDeployer:
      jboss.jca:service=LocalTxCM,name=MySqlDS

      then the problem is solved.

      However, I cannot imagen that I have to modify this file each time I add a datasource.

      So: What is the proper way to define a dependency between an entity bean and its datasource (binding)?

        • 1. Re: How to configure an mbean dependency

          You will need to make this dependency if you
          have sars that contain ejbs.

          sars are deployed first.

          You can also specify the dependency in
          jboss.xml for the ejb.

          Regards,
          Adrian

          • 2. Re: How to configure an mbean dependency
            reitsma

            Well, according to the (getting started) docs, a SAR is deployed inside out, so the EJB is deployed before the mbean. That is why I cannot put the dependency in jboss-service.xml accompaning the mbean.

            The jboss_3_0.dtd does not state anything about dependencies. Could you elaborate on this?

            I don't understand why JBoss does not resolve the dependency itself. It knows the datasource used by the entity bean from the jaws.xml ...

            • 3. Re: How to configure an mbean dependency

              The deployment order is determined initially
              by the top level package.

              For jboss.xml

              <ejb-name>whatever</ejb-name>
              jmx object name
              ...


              The dependencies work at the jmx service level.
              We currently have no mechanism to make
              a dependency based on a jndi element being bound.

              Regards,
              Adrian

              • 4. Re: How to configure an mbean dependency
                reitsma

                I don't quite get it, in the jboss_3_0.dtd (nor 3_2)there is no such element as . Could you explain please? Remember, I am using 3.0.7.

                • 5. Re: How to configure an mbean dependency

                  You are correct.

                  It looks like it was only added to jboss_3_2.dtd
                  in the 3.2 release.

                  It will still work in 3.0, I will fix the dtd.

                  Regards,
                  Adrian