lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (LUCENE-844) org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException
Date Thu, 22 Mar 2007 20:33:32 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael McCandless resolved LUCENE-844.
---------------------------------------

    Resolution: Duplicate

Thanks for opening this issue!

This is actually fixed already on the trunk (not yet released) under LUCENE-825.



> org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException
> -----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-844
>                 URL: https://issues.apache.org/jira/browse/LUCENE-844
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 2.1
>            Reporter: Jean-Philippe Robichaud
>
> When writing a WeakReference based cache for storing IndexReader objects, I was hit by
a NullPointerException thrown from nowhere
> The actual stacktrace I got is:
> java.lang.NullPointerException
>         at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:482)
>         at org.apache.lucene.index.IndexReader.open(IndexReader.java:147)
>         at org.apache.lucene.index.IndexReader.open(IndexReader.java:142)
> <...>
> The culprit  code is in org.apache.lucene.index.SegmentInfos.FindSegmentsFile :
> [line 471] 
>   if (0 == method) {
>           if (directory != null) {
>             files = directory.list();
>           } else {
>             files = fileDirectory.list();
>           }
>           gen = getCurrentSegmentGeneration(files);
>           if (gen == -1) {
>             String s = "";
>             for(int i=0;i<files.length;i++) { << EXCEPTION THROWN FROM HERE
[line 482]
>               s += " " + files[i];
>             }
>             throw new FileNotFoundException("no segments* file found: files:" + s);
>           }
>         }
> A check on the "files" object is required as the fileDirectory.list() can return null.
> In my case, the problem came from the fact that I had no more FileDescriptor available
(bug somewhere else in my code) but the NPE was the only info I got...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message