Hi Michael...
Here's the traceback:
[Indexer.java 652] buildFullIndex: Error building full index
java.io.IOException: Cannot rename
D:\indexbuild1\contact_index\deleteable.new to
D:\indexbuild1\contact_index\deletable at
org.apache.lucene.store.FSDirectory.renameFile(FSDirectory.java:294) at
org.apache.lucene.index.IndexWriter.writeDeleteableFiles(IndexWriter.jav
a:827) at
org.apache.lucene.index.IndexWriter.deleteSegments(IndexWriter.java:771)
at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:732)
at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:686)
at
org.apache.lucene.index.IndexWriter.maybeMergeSegments(IndexWriter.java:
674)at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:479)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:462)
at
com.glgroup.glissando.Indexer.indexAllDocuments(Indexer.java:546) at
com.glgroup.glissando.Indexer.buildFullIndex(Indexer.java:646) at
com.glgroup.glissando.Indexer.buildIndex(Indexer.java:728) at
com.glgroup.glissando.Indexer.buildIndices(Indexer.java:845) at
com.glgroup.glissando.IndexingService.stepService(IndexingService.java:3
9) at
com.glgroup.util.threading.ServiceThread.run(ServiceThread.java:60)
Caused by: java.io.FileNotFoundException:
D:\indexbuild1\contact_index\deletable (Access is denied) at
java.io.FileOutputStream.open(Native Method) at
java.io.FileOutputStream.<init>(Unknown Source) at
java.io.FileOutputStream.<init>(Unknown Source) at
org.apache.lucene.store.FSDirectory.renameFile(FSDirectory.java:278)
... 13 more
So you can see, yes it's exactly in that spot. Given the
circumstances we've seen, it seems like File.renameTo() is working most
of the time but whatever causes it to fail at this specific point in
time also causes the
New FileOutputStream (nu);
to blow up 2 lines later.
As I said, the trigger seems to be Windows Explorer doing a
refresh at the same moment that Lucene is trying to do one of these
swaps. I don't know if this is a weakness in the jvm implementation of
the file classes or what, but I've found complaints/bugs about the java
file interactions on windows coming up to 2004.
-Mark
This e-mail message, and any attachments, is intended only for the use of the
individual or entity identified in the alias address of this message and may
contain information that is confidential, privileged and subject to legal
restrictions and penalties regarding its unauthorized disclosure and use. Any
unauthorized review, copying, disclosure, use or distribution is strictly
prohibited. If you have received this e-mail message in error, please notify
the sender immediately by reply e-mail and delete this message, and any
attachments, from your system. Thank you.
-----Original Message-----
From: Michael McCandless [mailto:[EMAIL PROTECTED]
Sent: Friday, August 04, 2006 5:28 PM
To: [email protected]
Subject: Re: running a lucene indexing app as a windows service on xp,
crashing
> The Lucene code is crashing under circumstances that seem pretty lame.
> At periodic intervals, lucene tries to File.renameTo(newfile).
> Sometimes this fails, so Lucene implemented some fall-back code to
> manually copy the contents of the file from old to new. Our problem
is
> that sometimes *this* fails too, then the whole thing blows up.
I agree Lucene should not be affected by things like having Windows
Explorer windows up!
Can you post the traceback you're seeing? In particular, what's failing
about the fallback approach?
Is it in the FSDirectory's renameFile method? There is this comment in
there:
// Rename the old file to the new one. Unfortunately, the
renameTo()
// method does not work reliably under some JVMs. Therefore, if
the
// rename fails, we manually rename by copying the old file to the
new one
and correspondingly this comment in the original commit for this (back
on March 1 2003):
- Added a manual renaming of files in case the java.io.File's
renameTo(File)
call fails. It has been reported that this happens on Windows JVMs.
Contributed by: Matt Tucker
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]