That exception actually isn't during commit -- it's during
addDocument. Are you saying there was a separate thread calling
commit at the same time?
The error is very odd: Lucene is trying to create the file _3.fdt
(open for "rw" as you noted), yet hit a FileNotFoundException. Can
you check that the index directory is actually writable by your
process, and reply back with the "ls -l" output?
The "unable to unlink" error is probably just Lucene trying to clean
up on handling the exception.
It's OK for the JVM to be kill -9'd in 2.4 as well as 2.3 (it won't
corrupt your index). It's OS/hardware crashes, power loss, etc, where
2.3 could corrupt the index but 2.4 shouldn't.
Mike
Andrew Zhang wrote:
Hi,
I met FileNotFoundException when using lucene 2.4.0. Please see the
stack trace[1] below. I checked the code of lucene-2.4, found the
following code throws FileNotFoundException:
file = new RandomAccessFile(path, "rw");
I checked system log, and found a warning before the exception:
unable to unlink '/sdcard/.servo/.index/_3.fdt' (errno=2)
Any hint what the problem is? Possible race condition during commit?
My index process was killed by system somtimes, but I assume it's OK
for lucene-2.4.
Thanks a lot in advance!
[1]
java.io.FileNotFoundException: /sdcard/.servo/.index/_3.fdt
at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
227)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:109)
at org.apache.lucene.store.FSDirectory
$FSIndexOutput.<init>(FSDirectory.java:639)
at
org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:442)
at org.apache.lucene.index.FieldsWriter.<init>(FieldsWriter.java:
62)
at
org
.apache
.lucene
.index.StoredFieldsWriter.initFieldsWriter(StoredFieldsWriter.java:67)
at
org
.apache
.lucene
.index.StoredFieldsWriter.finishDocument(StoredFieldsWriter.java:141)
at org.apache.lucene.index.StoredFieldsWriter
$PerDoc.finish(StoredFieldsWriter.java:187)
at org.apache.lucene.index.DocumentsWriter
$WaitQueue.writeDocument(DocumentsWriter.java:1408)
at org.apache.lucene.index.DocumentsWriter
$WaitQueue.add(DocumentsWriter.java:1427)
at
org
.apache
.lucene.index.DocumentsWriter.finishDocument(DocumentsWriter.java:
1062)
at
org
.apache
.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:768)
at
org
.apache
.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:743)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1902)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1880)
--
Best regards,
Andrew Zhang
db4o - database for Android: www.db4o.com
http://zhanghuangzhu.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]