Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.String cannot be cast to java.util.Map #27

Open
dozturk opened this issue Nov 9, 2018 · 2 comments
Open

java.lang.String cannot be cast to java.util.Map #27

dozturk opened this issue Nov 9, 2018 · 2 comments

Comments

@dozturk
Copy link

dozturk commented Nov 9, 2018

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)

@ezestrushikesh
Copy link

ezestrushikesh commented Jun 20, 2019

Did you get any solution to this? I am also stuck at this problem.
I am using CDH 5.16.1's Solr version 4.10.3. However, If I use Apache Solr 7, I don't get this issue

@uttamraj9
Copy link

I am also getting same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants