This content has been marked as final.
Show 2 replies
-
1. Re: getting AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource
jaysensharma Nov 25, 2014 4:40 AM (in response to rajajboss)1 of 1 people found this helpfulThe 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)
-
2. Re: getting AttributeNotFoundException: "JBAS014640: 'statistics' is a registered child of resource
rajajboss Nov 25, 2014 4:45 AM (in response to jaysensharma)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.