You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ABDOU Samir <sa...@unine.ch> on 2004/11/19 15:38:06 UTC

Null Pointer Exception in clone method of TermVectorsReader class!

Hello everybody,

I got the null pointer exception in the method clone of the
TermVectorsReader class. Exactly in the given statement:    
clone.tvx = (IndexInput) tvx.clone();

This happens when trying to indexing.

I think that is due to the constructor of that class. 

  TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos)
    throws IOException {
    if (d.fileExists(segment + TermVectorsWriter.TVX_EXTENSION)) {
      tvx = d.openInput(segment + TermVectorsWriter.TVX_EXTENSION);
      checkValidFormat(tvx);
      tvd = d.openInput(segment + TermVectorsWriter.TVD_EXTENSION);
      tvdFormat = checkValidFormat(tvd);
      tvf = d.openInput(segment + TermVectorsWriter.TVF_EXTENSION);
      tvfFormat = checkValidFormat(tvf);
      size = (int) tvx.length() / 8;
    }
->    else {
->    	System.out.println("The file " + segment + " doesn't exist !");
->    }

    this.fieldInfos = fieldInfos;
  }
  
So my question: what happens when a segment doesn't exist!? I think that
the exception is due to this because tvx may be null in this case!

Thanks
Samir




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


Re: Null Pointer Exception in clone method of TermVectorsReader class!

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Samir,

Can you reproduce this with the very latest Lucene from CVS?
If you can, could you write a little class that reproduces this
exception and stick it in Bugzilla, please?

I'm using Term Vectors on simpy.com, and I haven't had any issues with
them.

Thanks,
Otis


--- ABDOU Samir <sa...@unine.ch> wrote:

> 
> Hello everybody,
> 
> I got the null pointer exception in the method clone of the
> TermVectorsReader class. Exactly in the given statement:    
> clone.tvx = (IndexInput) tvx.clone();
> 
> This happens when trying to indexing.
> 
> I think that is due to the constructor of that class. 
> 
>   TermVectorsReader(Directory d, String segment, FieldInfos
> fieldInfos)
>     throws IOException {
>     if (d.fileExists(segment + TermVectorsWriter.TVX_EXTENSION)) {
>       tvx = d.openInput(segment + TermVectorsWriter.TVX_EXTENSION);
>       checkValidFormat(tvx);
>       tvd = d.openInput(segment + TermVectorsWriter.TVD_EXTENSION);
>       tvdFormat = checkValidFormat(tvd);
>       tvf = d.openInput(segment + TermVectorsWriter.TVF_EXTENSION);
>       tvfFormat = checkValidFormat(tvf);
>       size = (int) tvx.length() / 8;
>     }
> ->    else {
> ->    	System.out.println("The file " + segment + " doesn't exist
> !");
> ->    }
> 
>     this.fieldInfos = fieldInfos;
>   }
>   
> So my question: what happens when a segment doesn't exist!? I think
> that
> the exception is due to this because tvx may be null in this case!
> 
> Thanks
> Samir
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 
> 


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