lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: opening an IndexWriter for an exisiting index causing lock exception
Date Mon, 08 Jan 2007 23:38:29 GMT
S Edirisinghe wrote:

> I'm having a write lock problem when I try to open an existing index.
> When I try to open the index with the recreate set to false, I get this
> exception
> Lock obtain timed out: Lock@/tmp/lucene-
> e683c0b3e52b8094bba62b22617efd41-write.lock
>    at
>    at org.apache.lucene.index.IndexWriter.<init>(
>    at org.apache.lucene.index.IndexWriter.<init>(
>    at
>    at<init>(
>    at<init>(
>    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>    at sun.reflect.NativeConstructorAccessorImpl.newInstance(
>    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>    at java.lang.reflect.Constructor.newInstance(
>    at org.junit.internal.runners.TestClassMethodsRunner.createTest(

Which version of Lucene are you using?

By far the most common cause of this is a leftover lock file from a
previous un-graceful exit.

But it sounds like you've checked that already.

So if you're certain that this lock file name is not in fact present
when you start your application, maybe double check that no other code
is creating an IndexWriter (or that your openIndex is not being called
more than once)?  Or you're not running two threads through this code?

Actually, since you're running under Junit, are you sure there wasn't
another test case that had failed to close its writer against this


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

View raw message