0

I want to graph usage stats from my application in Graphite. I'm trying to get Jmxtrans up and running. The object I want to query is:

org.glassfish.jersey:type=my-server,subType=Uris,resource="/resource.js",executionTimes=RequestTimes

In my config I have:

"obj": "org.glassfish.jersey:type=my-server,subType=Uris,resource=\"/resource.js\",executionTimes=RequestTimes"

But this is causing the following error:

[06 Feb 2016 22:12:29] [jmxtrans-query-2] 363453 ERROR (com.googlecode.jmxtrans.jmx.ProcessQueryThread:57) - Error executing query Query(objectName=org.glassfish.jersey:type=reflow-ad-server,subType=Uris,resource=*,executionTimes=RequestTimes, keys=[], attr=[AverageTime[ms]_1m, RequestRate[requestsPerSeconds]_1m], typeNames=[], resultAlias=router_bootstrap_js, useObjDomainAsKey=false, allowDottedKeys=false, useAllTypeNames=false, outputWriterInstances=[BaseOutputWriter(typeNames=[name], debugEnabled=true, settings={}, valueTransformer=com.googlecode.jmxtrans.model.results.IdentityValueTransformer@6d2efbbd), com.googlecode.jmxtrans.model.output.support.ResultTransformerOutputWriter@27916d4b]) on server Server(pid=null, host=log-emea-5, port=9091, url=service:jmx:rmi:///jndi/rmi://log-emea-5:9091/jmxrmi, cronExpression=null, numQueryThreads=0)
java.lang.NullPointerException
        at com.googlecode.jmxtrans.model.Query.fetchResults(Query.java:195)
        at com.googlecode.jmxtrans.model.Server.execute(Server.java:239)
        at com.googlecode.jmxtrans.jmx.ProcessQueryThread.run(ProcessQueryThread.java:54)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        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)

I've tried the object without the quotes but unsurprisingly the query returns nothing.

JohnnyD
  • 121
  • 2

1 Answers1

0

It turns out the call to javax.management.MBeanServerConnection.getAttributes(...) returns null however calling javax.management.MBeanServerConnection.getAttribute(...) for each attribute in a loop works ok.

Looks like a bug in javax.management.MBeanServerConnection.getAttributes(...) rather than a problem with jmxtrans itself.

See this code for a fix:

https://github.com/jmxtrans/jmxtrans/compare/master...jdudmesh:master

JohnnyD
  • 121
  • 2