2 Replies Latest reply on Nov 25, 2014 4:45 AM by raja reddy

    getting AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource

    raja reddy Newbie

      Dear All,

       

      I am trying display the jmx attributes from jboss.as\:subsystem\=datasources,data-source\=XXXX =XXXDS mbean in the custom gui developed by us.Since the jmx attribute  statistics value is "unavailabale" , i am facing the below exception. Can anybody help me on this

       

      13:06:21,121 SEVERE  (http-/127.0.0.1:8080-1) null: javax.management.AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource ([

          (\"subsystem\" => \"datasources\"),

          (\"data-source\" => \"XXXXXSM\")

      ])"

              at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:225)

              at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:189)

              at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.getAttribute(ModelControllerMBeanServerPlugin.java:88)

              at org.jboss.as.jmx.PluggableMBeanServerImpl.getAttribute(PluggableMBeanServerImpl.java:171)

       

      Thanks,

      Raja

        • 1. Re: getting AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource
          Jay SenSharma Master

          The statistics are only exposed to the management API not via MBeans so try using CLI:


          [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true)
          {
              "outcome" => "success",
              "result" => {
                  "ActiveCount" => "1",
                  "AvailableCount" => "20",
                  "AverageBlockingTime" => "0",
                  "AverageCreationTime" => "150",
                  "CreatedCount" => "1",
                  "DestroyedCount" => "0",
                  "InUseCount" => "0",
                  "MaxCreationTime" => "150",
                  "MaxUsedCount" => "1",
                  "MaxWaitCount" => "0",
                  "MaxWaitTime" => "0",
                  "TimedOut" => "0",
                  "TotalBlockingTime" => "0",
                  "TotalCreationTime" => "150"
              }
          }
          
          

           

          Looks like your utility is trying something like following, Which is wrong and will cause the same error:

           

          package client;
          import javax.management.*;
          import javax.management.remote.*;
          import test.startup.*;
          public class JMXExample {
              public static void main(String[] args) throws Exception {
                  String host = "localhost";
                  int port = 9999;
                  String urlString ="service:jmx:remoting-jmx://" + host + ":" + port;
                  System.out.println("\n\n\t****  urlString: "+urlString);;
                  JMXServiceURL serviceURL = new JMXServiceURL(urlString);
                  JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);
                  MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
          
                  ObjectName objectName=new ObjectName("jboss.as:subsystem=datasources,data-source=ExampleDS");
                  connection.getAttribute(objectName,"statistics");
                  jmxConnector.close();
              }
          }
          
          

           

           

          Output

           

          Exception in thread "main" javax.management.AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource ([
              (\"subsystem\" => \"datasources\"),
              (\"data-source\" => \"ExampleDS\")])"
              at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:225)
              at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:189)
              at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.getAttribute(ModelControllerMBeanServerPlugin.java:88)
              at org.jboss.as.jmx.PluggableMBeanServerImpl.getAttribute(PluggableMBeanServerImpl.java:171)
              at org.jboss.remotingjmx.protocol.v2.ServerProxy$GetAttributeHandler.handle(ServerProxy.java:654)
              at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
          
          
          1 of 1 people found this helpful
          • 2. Re: getting AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource
            raja reddy Newbie

            Hi Jay Kumar,

            Thank you for your kind reply.

             

            But my requirement is i need to display the whatever the jmx  attributes present in the jconsole under datasources.When I checked the jconsole, statistics is one of the aatributes under datasources. we developed the jsf,spring web application in which we need to display the jmx attributes to manage the application.

             

            KIndly help.