[jboss-jira] [JBoss JIRA] Created: (JBAS-3936) 'Class does not expose a management interface:' class will allways be java.lang.Object

Hugo Hallman (JIRA) jira-events at jboss.com
Mon Dec 11 03:41:38 EST 2006


'Class does not expose a management interface:' class will allways be java.lang.Object
--------------------------------------------------------------------------------------

                 Key: JBAS-3936
                 URL: http://jira.jboss.com/jira/browse/JBAS-3936
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: JMX
    Affects Versions: JBossAS-4.0.5.GA
         Environment: Any
            Reporter: Hugo Hallman
         Assigned To: Scott M Stark
            Priority: Trivial


The error message given when deploying a non-jmx bean will allways be:
"Class does not expose a management interface: java.lang.Object", and should instead obviously be mentioning the given implementation class. The problem is that when looping down the object hierarchy to find a JMX compatible class, the requested class is forgotten for the error message.


Proposed solution:
\jboss-4.0.4.GA-src.tar\jboss-4.0.4.GA-src\jmx\src\main\org\jboss\mx\metadata\MBeanCapability.java
(Problem remains in 4.0.5.GA: http://fisheye.jboss.com/browse/JBossAS/tags/JBoss_4_0_5_GA/jmx/src/main/org/jboss/mx/metadata/MBeanCapability.java?r=Branch_4_0)

      // If the MyClass MBean is an instance of a MyClassMBean interface, MyClass is a standard MBean
      for(Class current = mbeanClass; current != null; current = current.getSuperclass()) {
          Class [] interfaces = current.getInterfaces();
          for (int i = 0; i < interfaces.length; i++)
          {
             Class anInterface = interfaces[i];
             if (anInterface.getName().equals(current.getName() + "MBean"))
             {
                return new MBeanCapability(STANDARD_MBEAN);
             }
          }
      }

      throw new NotCompliantMBeanException("Class does not expose a management interface: " + mbeanClass.getName());


Note that the proposed solution has NOT been tested.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list