lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: NullPointerExc in CloseableThreadLocal... (Lucene 3.0.0)
Date Wed, 13 Jan 2010 16:52:16 GMT
Is it possible you are closing the searcher before / while running
that for loop?

Mike

On Wed, Jan 13, 2010 at 9:26 AM, Konstantyn Smirnov <injecteer@yahoo.com> wrote:
>
> Hi all
>
> Consider the following piece of code:
>
> Searcher s = this.getSearcher()
> def hits = s.search( query, filter, params.offset + params.max, sort )
>
> for( hit in hits.scoreDocs[ lower..<upper ] ){
>   def obj = binder( s.doc( hit.doc ), hit.doc ) // << here the NPE is
> thrown
> }
>
> the code *sporadically* throws the following:
>
>        ... 6 more
> Caused by: java.lang.NullPointerException
>        at
> org.apache.lucene.util.CloseableThreadLocal.get(CloseableThreadLocal.java:64)
>        at
> org.apache.lucene.index.SegmentReader.getFieldsReader(SegmentReader.java:778)
>        at
> org.apache.lucene.index.SegmentReader.document(SegmentReader.java:879)
>        at
> org.apache.lucene.index.DirectoryReader.document(DirectoryReader.java:518)
>        at
> org.apache.lucene.index.IndexReader.document(IndexReader.java:658)
>        at
> org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:144)
>        at SearchableService.asResult(SearchableService.groovy:128)
>
> I assume, that the reason for that could be indexing of a new document/
> expungeDeletes() / re-openning the IndexReader.
>
> Can you elaborate on this? Shall I implement/configure some sort of
> time-out?
>
> Thanks in advance
>
> -----
> Konstantyn Smirnov, CTO
> http://www.poiradar.ru www.poiradar.ru
> http://www.poiradar.com.ua www.poiradar.com.ua
> http://www.poiradar.com www.poiradar.com
> http://www.poiradar.de www.poiradar.de
> --
> View this message in context: http://old.nabble.com/NullPointerExc-in-CloseableThreadLocal...-%28Lucene-3.0.0%29-tp27145825p27145825.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message