lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Swapnil Katkar <skatkar...@gmail.com>
Subject Fwd: Java object binding not working
Date Fri, 08 Feb 2019 18:30:40 GMT
Hi,

It would be beneficial to me if you provide me at least some hint to
resolve this problem. Thanks in advance!

Regards,
Swapnil Katkar



---------- Forwarded message ---------
From: Swapnil Katkar <skatkar225@gmail.com>
Date: Tue, Feb 5, 2019 at 10:58 PM
Subject: Fwd: Java object binding not working
To: <solr-user@lucene.apache.org>


Hello,

Could you please let me know how can I get the resolution of the mentioned
issue?

Regards,
Swapnil Katkar

---------- Forwarded message ---------
From: Swapnil Katkar <skatkar225@gmail.com>
Date: Sun, Feb 3, 2019, 17:31
Subject: Java object binding not working
To: <solr-user@lucene.apache.org>


Greetings!

I am working on a requirement where I want to query the data and want to do
the object mapping for the retrieved result using Solrj. For this, I am
referring to the official document at
*https://lucene.apache.org/solr/guide/7_6/using-solrj.html#java-object-binding
<https://lucene.apache.org/solr/guide/7_6/using-solrj.html#java-object-binding>.*
I
set-up the necessary class files and the collections.

With the help of this document, I can create the documents in the Solr DB,
but it is not working for fetching and mapping the fields to the Java POJO
class. To do the mapping, I used @Field annotation.

Details are as below:
*1)* Solrj version: 7.6.0
*2)* The line of code which is not working: *List<Employee> employees =
response.getBeans(Employee.class);*
*3)* Exception stack trace:
*Caused by: java.lang.IllegalArgumentException: Can not set
java.lang.String field demo.apache.solr.vo.Employee.name
<http://demo.apache.solr.vo.Employee.name> to java.util.ArrayList*
* at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)*
* at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)*
* at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)*
* at java.lang.reflect.Field.set(Unknown Source)*
*4)* Collection was created using
        *solr.cmd create -c employees -s 2 -rf 2*

Please find the attached source code files. Also, I attached the stack
trace file. Can you please help me on how to resolve them?

Regards,
Swapnil Katkar


-- 
Hello,


Regards,
Swapnil Katkar

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