Description of problem: I've seen this problem, namely with the metrics pane: http://...:7080/coregui/#Resource/253947/Monitoring/Metrics Fri Nov 15 13:16:37 GMT-800 2013 SEVERE: At [Fri Nov 15 13:16:37 GMT-800 2013] MessageCenter received: Globally uncaught exception BFEEEABEC1A9CFF9B91A5BEF7FF23A9C.cache.html:3460 Fri Nov 15 13:16:37 GMT-800 2013 WARNING: Globally uncaught exception com.google.gwt.core.client.JavaScriptException: (TypeError) stack: TypeError: Cannot call method 'compareTo$' of null at Object.compare_0 [as compare] (<anonymous>:9013:40) at insertionSort (<anonymous>:8896:33) at mergeSort_0 (<anonymous>:8922:5) at mergeSort_0 (<anonymous>:8929:3) at mergeSort_0 (<anonymous>:8929:3) at mergeSort_0 (<anonymous>:8929:3) at mergeSort (<anonymous>:8915:3) at $queryResourceMetrics (<anonymous>:109611:3) at $onSuccess_434 (<anonymous>:109677:3) I'm guessing that queryResourceMetrics is trying to sort something that's null: public void queryResourceMetrics(final Resource resource, Long startTime, Long endTime, final CountDownLatch countDownLatch) { Set<MeasurementDefinition> definitions = resource.getResourceType().getMetricDefinitions(); //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071] final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>(); for (MeasurementDefinition definition : definitions) { measurementDefMap.put(definition.getDisplayName(), definition); } //bundle definition ids for asynch call. definitionArrayIds = new int[definitions.size()]; final String[] displayOrder = new String[definitions.size()]; measurementDefMap.keySet().toArray(displayOrder); So there are metric definitions that have a null display name? This is with my own custom plugin. Version-Release number of selected component (if applicable): 4.9 How reproducible: Always Steps to Reproduce: 1. Create a metric definition with an empty display name (Oracle '' == null) 2. Display the metrics 3. Actual results: Global Error Expected results: Shows data. Additional info:
This is caused by a bad plugin: How to reproduce: 1. Create two metrics with the same display name: <metric property="decr_misses" displayType="detail" displayName="Decr misses" description="Number of decr reqs against missing keys" ... <metric property="cas_misses" displayType="detail" displayName="Decr misses" description="Number of CAS reqs against missing keys" units="none" measurementType="trendsup"/> The assumption in MetricsViewDataSource.java is that the number of definitions will match the number of unique display names. //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071] final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>(); for (MeasurementDefinition definition : definitions) { measurementDefMap.put(definition.getDisplayName(), definition); } //bundle definition ids for asynch call. definitionArrayIds = new int[definitions.size()]; -> change to -> definitionArrayIds = new int[measurementDefMap.size()];
Thanks for the BZ Elias. commit 3cbe934a3b7f986ca816744bb2578bdfbad23e56 Author: Lukas Krejci <lkrejci> Date: Thu Jan 30 18:04:52 2014 +0100 [BZ 1031200] - Don't assume unique display names of metrics While having unique names generally is true and even desirable, we were throwing NPE's in the UI due to that assumption. Now the UI will just correctly show 2 metrics with the same name which will hint the user correctly that there's something wrong with the plugin, not with RHQ itself.
Note that the display name should never be empty. If it is not defined explicitly, it should be deduced from the name of the metric. The fix therefore doesn't account for null display names.
Bulk closing of 4.10 issues. If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.