1 Reply Latest reply on Apr 1, 2010 4:01 AM by Ondrej Medek

    Why MBean attributes is unavailable in JConsole

    Yuriy Alevohin Newbie

      Hello all!

       

      I'm developing MBean-service for JBoss. It deployes without any errors, but in JConsole for all MBean's attributes values are "Unavailable" (Screenshot is below). In jmx-console everything is ok.

      Please, help me to understand reason.

       

      System:

      JBoss 5.1.0.GA

      JDK1.5

       

      Deployment Structure:

       

      DISPATCHER.EAR

      |_DISPATCHER.JAR

           |_DispatchManagerMBean.class

           |_DispatchManager.class

           |_Some others classes EJB3

       

      Code listings:

       

      package ru.infon.malibu.ee.dispatch.service;
      import org.jboss.ejb3.annotation.Management;
      
      @Management
      public interface DispatchManagerMBean {
          String OBJECT_NAME = "ru.infon.malibu.ee.dispatch:service=DispatchManager";
          void create();
          void start();
          void stop();
          void destroy();
      
          int getOverloaded();
      
          int getCurrentSpeed();
      
          int getMaxSpeed();
      }
      

       

      package ru.infon.malibu.ee.dispatch.service;
      
      import org.jboss.ejb3.annotation.Management;
      import org.jboss.ejb3.annotation.Service;
      
      @Service(objectName = DispatchManagerMBean.OBJECT_NAME)
      @Management(DispatchManagerMBean.class)
      public class DispatchManagerService implements DispatchManagerMBean {
             
          public int getCurrentSpeed() {
              int currentSpeed;
              ...
              return currentSpeed;
          }
      
          public int getOverloaded() {
              return getCurrentSpeed() > getMaxSpeed() ? 1 : 0;
          }
      
          public int getMaxSpeed() {
              int maxSpeed;
              ...
              return maxSpeed;
          }
          
          ....
      
      }
      

       

      In JConsole there is some problems (all attributes is unavailable). I've noticed than MBean's icon is slightly differs from other MBeans icons.

      qustions_jconsole.png

      In JBoss's jmx-console everything is ok:

       

      jmx-console.png