lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: SpellChecker AlreadyClosedException issue
Date Thu, 09 Apr 2009 23:16:21 GMT

: My code looks like this:
: 
: Directory dir = null;
: try {
:    dir = FSDirectory.getDirectory("/path/to/dictionary");
:    SpellChecker spell = new SpellChecker(dir); // exception thrown here
:    // ...
:    dir.close();

: This code works, but in a highly concurrent situation AlreadyClosedException
: is being thrown when I try to instantiate the SpellChecker:
: org.apache.lucene.store.AlreadyClosedException: this Directory is closed

if an error only happens under high concurrent load, it suggests that 
perhaps you have multiple threads attempting to close the directory.  you 
haven't clarified whether "dir" is a local variable inside a method, or an 
instnace variable in an object which is getting reused by multiple 
threads -- so it's hard to guess.

: I use lucene-core-2.4.1.jar and lucene-spellchecker-2.4.1.jar and I can
: reproduce the error in both windows and linux.

if you have a fully exeuctable test case (instead of just an incomplete 
partial snippet) that you can share, people may be able to spot the 
problem, or at the very least run the test themselves to reproduce.


-Hoss


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


Mime
View raw message