3 Replies Latest reply on Jun 16, 2015 8:45 AM by Adam A R

    MBean depedency in JBoss AS 7.1.1

    Trupti R Newbie

      Hi all,

       

      I am facing a problem related to dependency of MBean on another MBean in JBoss AS 7.1.1.

       

      Following is my jboss-service.xml

           <server xmlns="urn:jboss:service:7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">

        

                   <mbean code="com.test.SettingsService" name="jboss.test:service=Settings">

                   </mbean>

       

                   <mbean code="com.test.engine.KeyService" name="jboss.test:service=KeyService">

                            <depends>jboss.test:service=Settings</depends>

                   </mbean>

          </server>   

       

      When I starts JBoss AS 7.1.1 in standalone mode, sometimes I get exception as

                          Caused by: javax.management.InstanceNotFoundException: jboss.test:service=Settings

                          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1092)

       

      This exception is random and occurs at times. It seems that JBoss AS 7.1.1 ignores <depends> attribute of MBean and tries to create it even before the dependent MBean instance is created.

       

      Is there any solution for this? I have lot many such services. So generic solutions will be help.

       

      Any ideas?