0 Replies Latest reply on Mar 21, 2012 11:05 AM by f.ulbricht

    Accessing JMX Bean results in "No child 'request-properties' exists"

    f.ulbricht Newbie

      Hello there,


      I want to access a JMX bean. I have tried this with a bean named like "jboss.as:deployment=MyApp.ear" and it works fine. Now I want to acces a bean named like "jboss.as:subsystem=security,security-domain=MY_DOMAIN". Note the two properties. The name I have copied from the "jconsole" application, so I expect it to be correct. In the tree this bean can be found at "jboss.as/security/MY_DOMAIN". When I use the following code to invoke a method on the bean:


      ObjectName beanName = new ObjectName("jboss.as:subsystem=security,security-domain=MY_DOMAIN");

      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);

      server.invoke(beanName, "flushCache", null, null);


      I get this exception:


      15:49:22,444 INFO  [stdout] (EJB default - 10) jboss.as:subsystem=security,security-domain=MY_DOMAIN

      15:49:22,453 ERROR [stderr] (EJB default - 10) java.util.NoSuchElementException: No child 'request-properties' exists

      15:49:22,454 ERROR [stderr] (EJB default - 10)  at org.jboss.dmr.ModelValue.requireChild(ModelValue.java:362)

      15:49:22,456 ERROR [stderr] (EJB default - 10)  at org.jboss.dmr.ObjectModelValue.requireChild(ObjectModelValue.java:298)

      15:49:22,456 ERROR [stderr] (EJB default - 10)  at org.jboss.dmr.ModelNode.require(ModelNode.java:812)

      15:49:22,457 ERROR [stderr] (EJB default - 10)  at org.jboss.as.jmx.model.ModelControllerMBeanHelper.invoke(ModelControllerMBeanHelper.java:355)

      15:49:22,459 ERROR [stderr] (EJB default - 10)  at org.jboss.as.jmx.model.ModelControllerMBeanHelper.invoke(ModelControllerMBeanHelper.java:342)

      15:49:22,460 ERROR [stderr] (EJB default - 10)  at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.invoke(ModelControllerMBeanServerPlugin.java:108)

      15:49:22,461 ERROR [stderr] (EJB default - 10)  at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:246)


      So, how can a access such a bean? Is the naming correct?