You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "kai.hu" <li...@hotmail.com> on 2008/04/11 04:45:47 UTC

about NullPointerException in DocumentsWriter$ThreadState.init(DocumentsWriter.java:751)

 i got a problem yesterday,
 java.lang.NullPointerException
 at 
org.apache.lucene.index.DocumentsWriter$ThreadState.init(DocumentsWriter.java:751)
 at 
org.apache.lucene.index.DocumentsWriter.getThreadState(DocumentsWriter.java:2391)
 at 
org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:2434)
 at 
org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:2422)
 at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1445)
 at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1424)

 so i debug the code ,found if the document add a null Field,it will throw 
this Exception. 


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


Re: about NullPointerException in DocumentsWriter$ThreadState.init(DocumentsWriter.java:751)

Posted by Michael McCandless <lu...@mikemccandless.com>.
I think this is something you just shouldn't do?

Ie, if you call Document.addField(null), it is silently accepted and  
then causes that exception when added the document, but my feeling is  
you shouldn't do that.

Mike

kai.hu wrote:
>
> i got a problem yesterday,
> java.lang.NullPointerException
> at org.apache.lucene.index.DocumentsWriter$ThreadState.init 
> (DocumentsWriter.java:751)
> at org.apache.lucene.index.DocumentsWriter.getThreadState 
> (DocumentsWriter.java:2391)
> at org.apache.lucene.index.DocumentsWriter.updateDocument 
> (DocumentsWriter.java:2434)
> at org.apache.lucene.index.DocumentsWriter.addDocument 
> (DocumentsWriter.java:2422)
> at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java: 
> 1445)
> at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java: 
> 1424)
>
> so i debug the code ,found if the document add a null Field,it will  
> throw this Exception.
>
> ---------------------------------------------------------------------
> 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