我无法让 JMeter PerfMon Metrics Collector 侦听器收集 JMX 数据。我已经启动了“serverAgent”。如插件主页https://code.google.com/p/jmeter-plugins/wiki/PerfMon中所述,我已经使用以下参数启动了远程 JBoss 服务器:
java -Dcom.sun.management.jmxremote.port=4711 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.ssl=false
然后,我配置 JMeter Perf Mon 侦听器以从端口“5444”收集数据,将 Metric 配置为收集“JMX”,以及 Metric 参数“gc-time”。在配置中,我将 JMX 连接参数定义为“localhost”和端口“4711”。
当我启动 JMeter 测试时,“serverAgent”会出现以下错误:
INFO 2013-03-22 16:16:06.682 [kg.apc.p] (): Starting measures: jmx:gc-time cpu:
ERROR: java.lang.NoSuchMethodError: method java.lang.String.isEmpty with signature ()Z was not found.
*** Problem's technical details go below ***
Exception in thread "main" java.lang.NoSuchMethodError: method java.lang.String.isEmpty with signature ()Z was not found.
at kg.apc.perfmon.metrics.JMXMetric.<init>(JMXMetric.java:35)
at kg.apc.perfmon.metrics.AbstractPerfMonMetric.createMetric(AbstractPerfMonMetric.java:65)
at kg.apc.perfmon.PerfMonMetricGetter.setUpMetrics(PerfMonMetricGetter.java:138)
at kg.apc.perfmon.PerfMonMetricGetter.processCommand(PerfMonMetricGetter.java:63)
at kg.apc.perfmon.PerfMonMetricGetter.processNextCommand(PerfMonMetricGetter.java:101)
at kg.apc.perfmon.PerfMonWorker.read(PerfMonWorker.java:210)
at kg.apc.perfmon.PerfMonWorker.processCommands(PerfMonWorker.java:97)
at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:150)
如果我只收集 CPU 和内存,那么 JMeter 一切正常。只有在收集 JMX 时,我才会收到此异常。有任何想法吗?谢谢!