You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by chris sleeman <ch...@gmail.com> on 2008/07/19 15:40:09 UTC

IllegalArgumentException with Solrj DocumentObjectBinder

Hi,

I have a multivalued Solr text field, called 'categories', which is mapped
to a String[] in my java bean. I am directly converting the search results
to this bean.
This works absolutely fine if the field has two or more values, but If the
field has exactly one value, I get the following exception -

*Caused by: java.lang.RuntimeException: Exception while setting value
: [Ljava.lang.Object;@15b48b2 on private java.lang.String[]
com.app.model.Unit.categories
	at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:230)
	at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:199)
	at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:57)
	at org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:256)
....
*


Is this a bug or am I missing something? I am using the latest 1.3 build.

-- 
Regards,
Chris

Re: IllegalArgumentException with Solrj DocumentObjectBinder

Posted by Ryan McKinley <ry...@gmail.com>.
committed in rev 678204

thanks nobel!


On Jul 19, 2008, at 2:40 PM, Noble Paul നോബിള്‍  
नोब्ळ् wrote:

> A patch is submitted in SOLR-536
>
> On Sat, Jul 19, 2008 at 11:23 PM, Noble Paul നോബിള്‍  
> नोब्ळ्
> <no...@gmail.com> wrote:
>> meanwhile , you can manage by making the field
>> List<String> categories;
>>
>> On Sat, Jul 19, 2008 at 11:22 PM, Noble Paul നോബിള്‍  
>> नोब्ळ्
>> <no...@gmail.com> wrote:
>>> it is a bug . I'll post a new patch
>>>
>>>
>>>
>>> On Sat, Jul 19, 2008 at 7:10 PM, chris sleeman <chris.sleeman@gmail.com 
>>> > wrote:
>>>> Hi,
>>>>
>>>> I have a multivalued Solr text field, called 'categories', which  
>>>> is mapped
>>>> to a String[] in my java bean. I am directly converting the  
>>>> search results
>>>> to this bean.
>>>> This works absolutely fine if the field has two or more values,  
>>>> but If the
>>>> field has exactly one value, I get the following exception -
>>>>
>>>> *Caused by: java.lang.RuntimeException: Exception while setting  
>>>> value
>>>> : [Ljava.lang.Object;@15b48b2 on private java.lang.String[]
>>>> com.app.model.Unit.categories
>>>>       at org.apache.solr.client.solrj.beans.DocumentObjectBinder 
>>>> $DocField.set(DocumentObjectBinder.java:230)
>>>>       at org.apache.solr.client.solrj.beans.DocumentObjectBinder 
>>>> $DocField.inject(DocumentObjectBinder.java:199)
>>>>       at  
>>>> org 
>>>> .apache 
>>>> .solr 
>>>> .client 
>>>> .solrj 
>>>> .beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:57)
>>>>       at  
>>>> org 
>>>> .apache 
>>>> .solr 
>>>> .client.solrj.response.QueryResponse.getBeans(QueryResponse.java: 
>>>> 256)
>>>> ....
>>>> *
>>>>
>>>>
>>>> Is this a bug or am I missing something? I am using the latest  
>>>> 1.3 build.
>>>>
>>>> --
>>>> Regards,
>>>> Chris
>>>>
>>>
>>>
>>>
>>> --
>>> --Noble Paul
>>>
>>
>>
>>
>> --
>> --Noble Paul
>>
>
>
>
> -- 
> --Noble Paul


Re: IllegalArgumentException with Solrj DocumentObjectBinder

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
A patch is submitted in SOLR-536

On Sat, Jul 19, 2008 at 11:23 PM, Noble Paul നോബിള്‍ नोब्ळ्
<no...@gmail.com> wrote:
> meanwhile , you can manage by making the field
> List<String> categories;
>
> On Sat, Jul 19, 2008 at 11:22 PM, Noble Paul നോബിള്‍ नोब्ळ्
> <no...@gmail.com> wrote:
>> it is a bug . I'll post a new patch
>>
>>
>>
>> On Sat, Jul 19, 2008 at 7:10 PM, chris sleeman <ch...@gmail.com> wrote:
>>> Hi,
>>>
>>> I have a multivalued Solr text field, called 'categories', which is mapped
>>> to a String[] in my java bean. I am directly converting the search results
>>> to this bean.
>>> This works absolutely fine if the field has two or more values, but If the
>>> field has exactly one value, I get the following exception -
>>>
>>> *Caused by: java.lang.RuntimeException: Exception while setting value
>>> : [Ljava.lang.Object;@15b48b2 on private java.lang.String[]
>>> com.app.model.Unit.categories
>>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:230)
>>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:199)
>>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:57)
>>>        at org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:256)
>>> ....
>>> *
>>>
>>>
>>> Is this a bug or am I missing something? I am using the latest 1.3 build.
>>>
>>> --
>>> Regards,
>>> Chris
>>>
>>
>>
>>
>> --
>> --Noble Paul
>>
>
>
>
> --
> --Noble Paul
>



-- 
--Noble Paul

Re: IllegalArgumentException with Solrj DocumentObjectBinder

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
meanwhile , you can manage by making the field
List<String> categories;

On Sat, Jul 19, 2008 at 11:22 PM, Noble Paul നോബിള്‍ नोब्ळ्
<no...@gmail.com> wrote:
> it is a bug . I'll post a new patch
>
>
>
> On Sat, Jul 19, 2008 at 7:10 PM, chris sleeman <ch...@gmail.com> wrote:
>> Hi,
>>
>> I have a multivalued Solr text field, called 'categories', which is mapped
>> to a String[] in my java bean. I am directly converting the search results
>> to this bean.
>> This works absolutely fine if the field has two or more values, but If the
>> field has exactly one value, I get the following exception -
>>
>> *Caused by: java.lang.RuntimeException: Exception while setting value
>> : [Ljava.lang.Object;@15b48b2 on private java.lang.String[]
>> com.app.model.Unit.categories
>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:230)
>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:199)
>>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:57)
>>        at org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:256)
>> ....
>> *
>>
>>
>> Is this a bug or am I missing something? I am using the latest 1.3 build.
>>
>> --
>> Regards,
>> Chris
>>
>
>
>
> --
> --Noble Paul
>



-- 
--Noble Paul

Re: IllegalArgumentException with Solrj DocumentObjectBinder

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
it is a bug . I'll post a new patch



On Sat, Jul 19, 2008 at 7:10 PM, chris sleeman <ch...@gmail.com> wrote:
> Hi,
>
> I have a multivalued Solr text field, called 'categories', which is mapped
> to a String[] in my java bean. I am directly converting the search results
> to this bean.
> This works absolutely fine if the field has two or more values, but If the
> field has exactly one value, I get the following exception -
>
> *Caused by: java.lang.RuntimeException: Exception while setting value
> : [Ljava.lang.Object;@15b48b2 on private java.lang.String[]
> com.app.model.Unit.categories
>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:230)
>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:199)
>        at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:57)
>        at org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:256)
> ....
> *
>
>
> Is this a bug or am I missing something? I am using the latest 1.3 build.
>
> --
> Regards,
> Chris
>



-- 
--Noble Paul