4 Replies Latest reply on Jan 27, 2007 4:05 PM by pavel.genevski

    Creating a MBean

      I am trying to create a mbean, but I get a strange exception

      org.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
       at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:178)
       at org.jboss.system.ServiceController.install(ServiceController.java:215)
       at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)


      I am using the code presented in the example from the wiki (http://wiki.jboss.org/wiki/Wiki.jsp?page=ExampleHelloWorldService), using the general extention of the interface (not extends ServiceMBean).

      What might be wrong? I do not implement a management interface? I implement a interface containing the start() and stop() methods (like the example)


        • 1. Re: Creating a MBean

          In frustration of not be able to create a "general" jmx bean, I tried extending the ServiceMBeanSupport explained in
          http://wiki.jboss.org/wiki/Wiki.jsp?page=ServiceMBeanSupport.

          However; the same error occurs:

          org.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
           at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:178)
           at org.jboss.system.ServiceController.install(ServiceController.java:215)
           at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          ....
          Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
           at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:88)
          


          Please help me!!!

          • 2. Re: Creating a MBean
            jaikiran

            Post your MBean code and the *-service.xml file.

            • 3. Re: Creating a MBean

              I just figured it out. I do not use the naming standard on MBeans (If the source class is named Serious, then the interface must be named SeriousMBean).

              A deep dive into the world of MBeans can be found here:
              http://www.oreilly.com/catalog/javamngext/chapter/ch02.pdf

              • 4. Re: Creating a MBean
                pavel.genevski

                This exception might occur if the MBean interface and the implementing class reside in different packages. I am not sure if it is JBoss specific issue or it is according to the JMX spec.