lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4405) java.lang.NumberFormatException: For input string: "4g3 (1)"
Date Tue, 18 Sep 2012 06:57:07 GMT


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

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:
>             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(
> 	at java.lang.Long.parseLong(
> 	at org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(
> 	at org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(
> 	at org.apache.lucene.index.SegmentInfos$
> 	at org.apache.lucene.index.SegmentInfos$
> 	at
> 	at org.apache.lucene.index.IndexWriter.<init>(

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:

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

View raw message