You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jean-Philippe Robichaud (JIRA)" <ji...@apache.org> on 2007/03/22 21:14:32 UTC

[jira] Created: (LUCENE-844) org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException

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


[jira] Commented: (LUCENE-844) org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483327 ] 

Michael McCandless commented on LUCENE-844:
-------------------------------------------

Good question, I'm not sure.  I think normally a point release (eg a 2.1.1) would happen if "enough" serious issues have been found and fixed since 2.1 was released, but there hasn't been much discussion yet on the dev list (java-dev) for a 2.1.1 release.

> 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


[jira] Commented: (LUCENE-844) org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException

Posted by "Jean-Philippe Robichaud (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483305 ] 

Jean-Philippe Robichaud commented on LUCENE-844:
------------------------------------------------

Oh, that's great.  Will it be released soon against the lucene_2_1 branch ?

> 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


[jira] Resolved: (LUCENE-844) org.apache.lucene.index.SegmentInfos.FindSegmentsFile.run() throwing NullPointerException

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ 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