1 Reply Latest reply on Feb 14, 2012 4:58 PM by asheffey

    Custom MBean monitor throwing NOTYETINSTALLED on server startup

    asheffey

      (Using a 4.0.2 server.)  I'm trying to crate a monitor for a custom MBean.  The MBean is registered in the JMX-Console as follows:

       

      name=MyCustomMBean,type=CustomMBeanClazzName

       

      I can create the monitor as follows:

       

              <mbean code="org.jboss.monitor.ThresholdMonitor"

                     name="jboss.monitor:service=MyCustomMBean Monitor">

                      <attribute name="MonitorName">MyCustomMBean Monitor</attribute>

                      <attribute name="ObservedObject">MyDomain:name=MyCustomMBean,type=CustomMBeanClazzName</attribute>

                      <attribute name="ObservedAttribute">SomeCount</attribute>

                      <attribute name="Threshold">5</attribute>

                      <attribute name="CompareTo">-1</attribute>

                      <attribute name="Period">1000</attribute>

                      <attribute name="Enabled">true</attribute>

                      <depends-list optional-attribute-name="AlertListeners">

                              <depends-list-element>jboss.alerts:service=ConsoleAlertListener</depends-list-element>

                              <depends-list-element>jboss.alerts:service=EmailAlertListener</depends-list-element>

                      </depends-list>

          </mbean>

       

      However, this monitor will throw exceptions on server startup because it depends on the MBean to be loaded, and it won't be loaded until my app is loaded.  I've tried changing the ObservedObject attribute to depends optional-attribute-name="ObservedObject", but JBoss throws NOTYETINSTALLED.

       

      I can't deploy this monitor if it can't wait for the custom MBean to load on server startup.

        • 1. Re: Custom MBean monitor throwing NOTYETINSTALLED on server startup
          asheffey

          I was able to find some posts that indicated that I can add a depends on a WAR, but that introduces another issue.  My WAR is displaying in the jmx-console under domain jboss.web.deployment as id=1517533031,war=hmyapp.war.  When I put this string in the <depends> tag, the monitor pends until the app is deployed, and all is well.

           

          However, this id will change between environments and deployments, so I can't use that identifier.

           

          Can I either 1) put some kind of wildcard into the name in place of the generated id, 2) reference that id via some kind of property, or 3) control that id in my app config.

           

          Or, am I out of luck on 4.0.2?