kafka-connect-solr
kafka-connect-solr copied to clipboard
java.lang.String cannot be cast to java.util.Map
I am trying to send a plain json messages from kafka to solr. I made it work on local computer but when I try it in the cluster (which has the cloudera distribution of solr version of 4.10.3) it doesnt work. I thought it might be the solrj version problem but I also use the same version of solr server on local computer where it works well.
I have also tried to change the solrj client version in dependencies from 7.5.0 to 4.10.3 but that creates another error of NoClassDefFound. So some classes are not present in the solrj client version 4.10.3
Below is the error message I receive from connect-distributed logs (but there are no error messages on the solr logs side):
I will really very appreciate if anybody can help or direct me for this issue? Thank you very much in advance
[2018-11-08 16:36:52,834] ERROR Request to collection [mh-eval-layer] failed due to (0) java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map, retry? 0 (org.apache.solr.client.solrj.impl.CloudSolrClient:919) [2018-11-08 16:36:52,835] ERROR WorkerSinkTask{id=SolrSink1-0} RetriableException from SinkTask: (org.apache.kafka.connect.runtime.WorkerSinkTask:577) org.apache.kafka.connect.errors.RetriableException: org.apache.solr.client.solrj.SolrServerException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map at com.github.jcustenborder.kafka.connect.solr.SolrSinkTask.put(SolrSinkTask.java:79) at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:564) at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:322) at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:225) at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:193) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.solr.client.solrj.SolrServerException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:999) at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:817) at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:194) at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:211) at com.github.jcustenborder.kafka.connect.solr.CloudSolrSinkTask.process(CloudSolrSinkTask.java:53) at com.github.jcustenborder.kafka.connect.solr.SolrSinkTask.put(SolrSinkTask.java:75) ... 11 more Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map at org.apache.solr.common.cloud.DocRouter.getRouteField(DocRouter.java:53) at org.apache.solr.common.cloud.CompositeIdRouter.sliceHash(CompositeIdRouter.java:46) at org.apache.solr.common.cloud.HashBasedRouter.getTargetSlice(HashBasedRouter.java:38)