lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igal @ getRailo.org" <i...@getrailo.org>
Subject Re: NPE when adding a Document to an IndexWriter
Date Thu, 10 Jan 2013 02:14:32 GMT
thanks for your reply.  please see attached.  I tried to maintain the 
structure of the code that I need to use in the library I'm building.  I 
think it should work for you as long as you remove the package 
declaration at the top.

when I run the attached file I get the following output:

debug:
Exception in thread "main" java.lang.NullPointerException
     at 
org.apache.lucene.analysis.util.CharacterUtils$Java5CharacterUtils.fill(CharacterUtils.java:191)
     at 
org.apache.lucene.analysis.util.CharTokenizer.incrementToken(CharTokenizer.java:153)
     at 
org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:102)
     at 
org.apache.lucene.index.DocFieldProcessor.processDocument(DocFieldProcessor.java:307)
     at 
org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:244)
     at 
org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:373)
     at 
org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1445)
     at 
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1124)
     at 
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1105)
     at s21waf.text.lucene4.TestNPE.testIndexWriter(TestNPE.java:47)
     at s21waf.text.lucene4.TestNPE.main(TestNPE.java:111)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

thanks,

Igal


On 1/9/2013 5:23 PM, Chris Hostetter wrote:
> : I keep getting an NPE when trying to add a Doc to an IndexWriter. I've
> : minimized my code to very basic code.  what am I doing wrong? pseudo-code:
>
> can you post a full test that other people can run to try and reproduce?
>
> it doesn't even have to be a junit test -- just some complete javacode
> people paste into a main method and compile would be enough (right now we
> have no idea what IndexWriterConfig you are using (could easily affect
> things) or what directory you are using (less likeley, but still)
>
>
> -Hoss
>
> ---------------------------------------------------------------------
> 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