1 Reply Latest reply on Jul 15, 2004 10:18 AM by adrian.brock

    Cross-dependencies between MBeans and EJB

    wizzie

      Hello

      We have a project that contains some number of beans (EJB) and MBeans. They have some dependency graph between then.
      When describing dependencies between MBeans there is no problem: it is easy to use MBean JMX name.
      When defining a dependency of EJB to MBean it is also not complicated: we use "container-configuration" extension in "jboss.xml".

      Now part under the question:
      for defining dependencies between EJBs, we use constructs like:
      jboss.j2ee:jndiName=...name here...

      When the system starts up, some MBeans instantly start to use some EJBs and we have a problem that sometimes systems starts up fine, sometimes there are failures in JNDI lookups (like EJB tries to resolve a JNDI proxy to a home interface and gets NULL).

      So the questions are:
      1. Is the general approach correct? Is it right to define dependencies between EJBs and MBeans in such a way and start using them during system startup?

      2. Do we define EJB dependencies correct? Shall we use different syntax (as it seems that there are several different MBeans that correspond to the same EJB)

      3. Any other ideas, why the system sometimes work and somtimes doesn't..

      BR
      VA

      PS. JBoss version is 3.2.3

        • 1. Re: Cross-dependencies between MBeans and EJB

          This depends upon your deployment. Making an MBean depend upon EJB
          will often promote the EJB to before other deployments, which means those other
          deployments have not started yet and hence have not been bound to JNDI.

          If it is random, then most likely you are missing a dependency. Sometimes
          you get the right order, sometimes you don't, probably depending upon
          the creation timestamps of the deployments. i.e. the order of the directory listing.