roaporl / solrmeter

Automatically exported from code.google.com/p/solrmeter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not update statistic com.plugtree.solrmeter.model.exception.StatisticConnectionException: java.lang.ClassCastException

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?

Run solrmeter and monitor cache statistics

What is the expected output? What do you see instead?

[Thread-1207]|ERROR|[CacheHistoryStatistic]|13:20:02,374 | Could not update 
statistic
com.plugtree.solrmeter.model.exception.StatisticConnectionException: 
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String
    at com.plugtree.solrmeter.model.statistic.RequestHandlerConnection.getData(RequestHandlerConnection.java:72)
    at com.plugtree.solrmeter.model.statistic.CacheHistoryStatistic.updateData(CacheHistoryStatistic.java:114)
    at com.plugtree.solrmeter.model.statistic.CacheHistoryStatistic$StatisticUpdateThread.run(CacheHistoryStatistic.java:163)
Caused by: java.lang.ClassCastException: java.lang.Float cannot be cast to 
java.lang.String
    at com.plugtree.solrmeter.model.statistic.RequestHandlerConnection.getCacheData(RequestHandlerConnection.java:84)
    at com.plugtree.solrmeter.model.statistic.RequestHandlerConnection.getData(RequestHandlerConnection.java:62)
    ... 2 more


What version of the product are you using? On what operating system?

solrmeter-0.3.0.jar, SOLR 4.6.0

Please provide any additional information below.

In SOLR 4.4 hit ratio was changed from String to float in the JMX interface. 
See also:
https://issues.apache.org/jira/browse/SOLR-4616
https://github.com/apache/lucene-solr/commit/17e8ee6573e69567ff7221e7907db38c600
33bf2

Original issue reported on code.google.com by thomas.p...@gmail.com on 13 Jan 2014 at 12:49

I'm attaching a patch that fixes this issue

Original comment by msoko...@safaribooksonline.com on 31 Mar 2014 at 7:16

Find attached the patch that worked for me (applied on trunk and using solr 
4.4). It has not been tested in depth, so please use it under your 
responsability.


note: I've attached it as I havent found the msoko...@safaribooksonline.com 
proposed one.

Original comment by acabrer...@emergya.com on 2 Apr 2014 at 9:25

Attachments:

I applied the patch with no complaints and rebuild fails in maven
javac 1.7.0_71
Building on Linux X86-64 environment if it matters

Can you really rebuild this in maven???

Tests in error:
  testConnectionData(com.plugtree.solrmeter.statistic.RequestHandlerConnectionTestCase): java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Float

testAllCachesPresent(com.plugtree.solrmeter.statistic.RequestHandlerConnectionTe
stCase): java.lang.ClassCastException: java.lang.String cannot be cast to 
java.lang.Float
  testCumulativeData(com.plugtree.solrmeter.statistic.RequestHandlerConnectionTestCase): java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Float
  testMissingCaches(com.plugtree.solrmeter.statistic.RequestHandlerConnectionTestCase): java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Float

Original comment by sy...@HAL9K.com on 6 Jan 2015 at 2:57