lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lu" <chris...@gmail.com>
Subject Re: NPE in IndexReader
Date Tue, 21 Aug 2007 21:52:23 GMT
Hi, Eric, I think I have the same problem.

I found out in latest MultiReader.java, the "SegmentInfos" is set to null.

  public MultiReader(IndexReader[] subReaders) throws IOException {
    super(subReaders.length == 0 ? null : subReaders[0].directory(),
          null, false, subReaders);
  }

However, segmentInfos are used in several places, causing NPEs.
For example, in IndexReader.acquireWriteLock(),

      if (SegmentInfos.readCurrentVersion(directory) >
segmentInfos.getVersion())
{

So I think MultiReader.java need some adjustments.


-- 
Chris Lu
-------------------------
Instant Scalable Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com
Lucene Database Search in 3 minutes:
http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes


On 8/21/07, Michael Busch <buschmic@gmail.com > wrote:
>
> Eric Louvard wrote:
> > Hello while calling IndexReader.deletedoc(int) I am becomming a NPE.
> >
> > java.lang.NullPointerException
> >        at
> > org.apache.lucene.index.IndexReader.acquireWriteLock(IndexReader.java
> :658)
> >        at
> > org.apache.lucene.index.IndexReader.deleteDocument (IndexReader.java
> :686)
> >
> > In the acquireWriteLock methode there is call
> > 'segmentInfos.getVersion()', but segmentInfos should be 'null'.
> >
> > I am working with the head revision from SVN.
> >
> > May someone tell me a work arround.
> >
> > regards, √Čric Louvard.
> >
>
> Hi Eric,
>
> could you please provide more information about how exactly you create
> the IndexReader? A unit test that hits this exception would be even
> better!
>
> Thanks,
> - Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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