lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Lopes <>
Subject NullPointerException in IndexSearcher
Date Tue, 30 Nov 2004 12:07:28 GMT
i have a problem with IndexSearcher, in the following code i get a 
NullPointerException when i try to create an IndexSearcher.
Here is the code:

   private static synchronized Searcher getSearcher( String indexDir ) 
throws IOException
       if( lastModified != IndexReader.lastModified( indexDir ) )
           // there's a new index, open it
           lastModified = IndexReader.lastModified( indexDir );
           searcher = new IndexSearcher( indexDir );   <======== The 
problem is in this line

       return searcher;

for some strange reason the searcher is null, the indexDir variable is 
correctly set to the index directory.

I try to reconstruct the index and i have no problems, but when i try to 
search it i get the same error.
This never happend before, there were no changes in the source code and 
the search always worked, but today i get that error.

There are no permission problems in the index files, all files are owned 
by the same user.
My java version is 1.4.1_02-b06.

Any help would be appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message