[ 
https://issues.apache.org/jira/browse/LUCENE-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457647#comment-13457647
 ] 

Uwe Schindler commented on LUCENE-4405:
---------------------------------------

Hi Radhakrishna,
the reason for this error is generally one of the following:
- You try to create a new index in a non-empty directory. If one of the files 
looks like a index file name it is taken into account. Use an empty directory 
for new indexes.
- You try to open an existing index, where non-lucene files are placed in it. 
The above filename looks like a cloned file (e.g. by pressing Ctrl-C, Ctrl-V in 
your file manager) causing this Exception. Clean up your index directory by 
removing the file that contains the above pattern from the Exception message - 
or recreate the index. File names are part of the Lucene index structure, so 
foreign names violate the "file format" (in our case it is more a directory 
format).

I would say this is wont fix for Lucene 3.x, but in Lucene trunk/4.x we should 
revisit this code and maybe rethrow the NumberFormatException as 
CorruptIndexException with the full file name and explanation (the above 
message only shows part of the file).
                
> java.lang.NumberFormatException: For input string: "4g3 (1)"
> ------------------------------------------------------------
>
>                 Key: LUCENE-4405
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4405
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 3.5
>         Environment: Windows 7 64 bit JDK
>            Reporter: Radhakrishna Bhat
>
> When trying to instantiate IndexWriter, I get this exception. I have no other 
> clues on why this might happen.
> Caused by: java.lang.NumberFormatException: For input string: "4g3 (1)"
>       at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>       at java.lang.Long.parseLong(Long.java:419)
>       at 
> org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(SegmentInfos.java:214)
>       at 
> org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(SegmentInfos.java:149)
>       at 
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:626)
>       at 
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:575)
>       at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:346)
>       at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1115)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to