lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Unable to obtain lock?
Date Tue, 22 Jun 2004 03:56:44 GMT
Steve,

Locking in Lucene has changed since version 1.2.  In that version lock
files were stored in the index directory, while in the version you are
using now they are stored in the system's temporary directory by
default.  Furthermore, their names have changed.  Therefore, make sure
that your temporary directory is writable by the user who is running
your Lucene application.  I use Lucene on Linux, so I do this when I
get locking errors like yours:

prompt> ls -al /tmp | grep -i lucene

If the found file looks stale, I manually remove it (rm ...).
You can also programmatically force unlocking of an index, if you want.

Finally, there is a Wiki page showing how you can change the directory
to store lock files, using system properties.  This can be handy if
your temp directory is not writable or some such.

Otis


--- Steve Rajavuori <SteveR@opin.com> wrote:
> I am seeing the following error when trying to open IndexWriter. I am
> now
> using Lucene 1.4-RC3, but I was previously using 1.2 to create this
> index.
> Any suggestions of how to fix this problem?
> 
> java.io.IOException: Lock obtain timed out
> 	at org.apache.lucene.store.Lock.obtain(Lock.java:58)
> 	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:216)
> 	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:172)
> 
> 
> Steve Rajavuori
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message