lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith Parker <paul.smith.par...@gmail.com>
Subject Solr 7.6.0 and Java 11: ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
Date Thu, 03 Jan 2019 14:16:34 GMT
Hello,

I am going nuts with an issue I noticed since upgrading to Java 11.

What I am using:
Java 11
Spring Boot 2.1.1 with spring-boot-starter-data-solr (amongst spring-data-jpa etc)
solr-solrj 7.6.0

What I am doing:

SolrCrudRepository.saveAll(documents)

What I am getting:

2019-01-03 13:47:54.830 ERROR (qtp735937428-22) [   x:documents] o.a.s.h.RequestHandlerBase
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String
(java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
	at org.apache.solr.common.util.JavaBinCodec.readSolrInputDocument(JavaBinCodec.java:601)
	at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:315)
	at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:256)
	at org.apache.solr.common.util.JavaBinCodec.readMapEntry(JavaBinCodec.java:781)
	at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:319)
	at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:256)
	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readOuterMostDocIterator(JavaBinUpdateRequestCodec.java:182)
	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readIterator(JavaBinUpdateRequestCodec.java:144)
	at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:311)
	at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:256)
	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readNamedList(JavaBinUpdateRequestCodec.java:130)

What I noticed:
The error seems to be on JavaBinCodec.readSolrInputDocument() where fieldName = (String)obj;
Initially I thought it was a problem with one of my document so I iterated over the collection
saving each document one by one with SolrCrudRepository.save(document): in this case I don’t
have the ClassCastException

Am I doing anything wrong? Or is it perhaps a bug?

Any help is very much appreciated!

Kind regards,
Paul


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message