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 Gauri Shankar <gs...@gmail.com> on 2015/09/15 17:49:33 UTC

Exception in SolrResponseBase.getQTime

Hi,

I need a bit of your help as we recently encountering an issue related to
"QTime" in solr response via solrj client.

java.lang.ClassCastException: java.lang.Long cannot be cast to
java.lang.Integer
 at
org.apache.solr.client.solrj.response.SolrResponseBase.getQTime(SolrResponseBase.java:76)
 at
.....
.....

I was exploring the source in -- org.apache.solr.core.SolrCore and there I
see that QTime is added as int only.

Other interesting observation is -- this is happening in one collection and
not happening in another collection while adding document to index.
Document are being added to both collection in similar way and they do have
the similar solrconfig...exactly same.

Could you please help me out on this?

-- 
Regards,
Gauri Shankar

Re: Exception in SolrResponseBase.getQTime

Posted by Gauri Shankar <gs...@gmail.com>.
Thanks much Shalin for this.

I will take a look into this one.

Btw, I am using SolrCloud 4.7.0.

Thanks again.

Gauri
On Sep 16, 2015 12:44 PM, "Shalin Shekhar Mangar" <sh...@gmail.com>
wrote:

> Okay, I found the problem, see
> https://issues.apache.org/jira/browse/SOLR-6547
>
> I have committed a fix which should be released with Solr 5.4. In the
> mean while, if you need access to the qtime for such responses,
> instead of using response.getQTime() do the following:
>
> int qtime = -1;
> NamedList header = response.getResponseHeader();
> if (header != null) {
>     qtime =  ((Number) header.get("QTime")).intValue();
> }
>
> On Wed, Sep 16, 2015 at 12:09 PM, Shalin Shekhar Mangar
> <sh...@gmail.com> wrote:
> > Hi Gauri,
> >
> > Can you give more details on when this happens? Which Solr version?
> > Also, can you please post the full stack trace?
> >
> > On Tue, Sep 15, 2015 at 9:19 PM, Gauri Shankar <gs...@gmail.com>
> wrote:
> >> Hi,
> >>
> >> I need a bit of your help as we recently encountering an issue related
> to
> >> "QTime" in solr response via solrj client.
> >>
> >> java.lang.ClassCastException: java.lang.Long cannot be cast to
> >> java.lang.Integer
> >>  at
> >>
> org.apache.solr.client.solrj.response.SolrResponseBase.getQTime(SolrResponseBase.java:76)
> >>  at
> >> .....
> >> .....
> >>
> >> I was exploring the source in -- org.apache.solr.core.SolrCore and
> there I
> >> see that QTime is added as int only.
> >>
> >> Other interesting observation is -- this is happening in one collection
> and
> >> not happening in another collection while adding document to index.
> >> Document are being added to both collection in similar way and they do
> have
> >> the similar solrconfig...exactly same.
> >>
> >> Could you please help me out on this?
> >>
> >> --
> >> Regards,
> >> Gauri Shankar
> >
> >
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Exception in SolrResponseBase.getQTime

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Okay, I found the problem, see https://issues.apache.org/jira/browse/SOLR-6547

I have committed a fix which should be released with Solr 5.4. In the
mean while, if you need access to the qtime for such responses,
instead of using response.getQTime() do the following:

int qtime = -1;
NamedList header = response.getResponseHeader();
if (header != null) {
    qtime =  ((Number) header.get("QTime")).intValue();
}

On Wed, Sep 16, 2015 at 12:09 PM, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> Hi Gauri,
>
> Can you give more details on when this happens? Which Solr version?
> Also, can you please post the full stack trace?
>
> On Tue, Sep 15, 2015 at 9:19 PM, Gauri Shankar <gs...@gmail.com> wrote:
>> Hi,
>>
>> I need a bit of your help as we recently encountering an issue related to
>> "QTime" in solr response via solrj client.
>>
>> java.lang.ClassCastException: java.lang.Long cannot be cast to
>> java.lang.Integer
>>  at
>> org.apache.solr.client.solrj.response.SolrResponseBase.getQTime(SolrResponseBase.java:76)
>>  at
>> .....
>> .....
>>
>> I was exploring the source in -- org.apache.solr.core.SolrCore and there I
>> see that QTime is added as int only.
>>
>> Other interesting observation is -- this is happening in one collection and
>> not happening in another collection while adding document to index.
>> Document are being added to both collection in similar way and they do have
>> the similar solrconfig...exactly same.
>>
>> Could you please help me out on this?
>>
>> --
>> Regards,
>> Gauri Shankar
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.



-- 
Regards,
Shalin Shekhar Mangar.

Re: Exception in SolrResponseBase.getQTime

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Hi Gauri,

Can you give more details on when this happens? Which Solr version?
Also, can you please post the full stack trace?

On Tue, Sep 15, 2015 at 9:19 PM, Gauri Shankar <gs...@gmail.com> wrote:
> Hi,
>
> I need a bit of your help as we recently encountering an issue related to
> "QTime" in solr response via solrj client.
>
> java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.lang.Integer
>  at
> org.apache.solr.client.solrj.response.SolrResponseBase.getQTime(SolrResponseBase.java:76)
>  at
> .....
> .....
>
> I was exploring the source in -- org.apache.solr.core.SolrCore and there I
> see that QTime is added as int only.
>
> Other interesting observation is -- this is happening in one collection and
> not happening in another collection while adding document to index.
> Document are being added to both collection in similar way and they do have
> the similar solrconfig...exactly same.
>
> Could you please help me out on this?
>
> --
> Regards,
> Gauri Shankar



-- 
Regards,
Shalin Shekhar Mangar.