lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: ClosedChannelException
Date Wed, 23 Feb 2011 11:34:37 GMT
Hey, are you using Thread.interrupt() or Future.cancel() somewhere in
your code? If so, this seems to be a limitation in java's NIO library.
see https://issues.apache.org/jira/browse/LUCENE-2239 for details.

If you are running on 64bit then you could try MMapDirectory there
this limitation is by far less likely to happen (only when you open
the index)

Simon

On Wed, Feb 23, 2011 at 12:24 PM, Akos Tajti <akos.tajti@gmail.com> wrote:
> Hi,
>
> I'm using lucene 3.0.3 on ubuntu and always getting ClosedChannelException:
>
> java.nio.channels.ClosedChannelException
> at sun.nio.ch.FileChannelImpl.ensureOpen(Unknown Source)
> at sun.nio.ch.FileChannelImpl.read(Unknown Source)
> at
> org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:168)
> at
> org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:160)
> at
> org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39)
> at org.apache.lucene.store.IndexInput.readVLong(IndexInput.java:99)
> at org.apache.lucene.index.SegmentTermEnum.next(SegmentTermEnum.java:135)
> at org.apache.lucene.index.SegmentMergeInfo.next(SegmentMergeInfo.java:69)
> at
> org.apache.lucene.index.DirectoryReader$MultiTermEnum.next(DirectoryReader.java:1045)
> at org.apache.lucene.search.FilteredTermEnum.next(FilteredTermEnum.java:77)
> at
> org.apache.lucene.search.FilteredTermEnum.setEnum(FilteredTermEnum.java:56)
> at org.apache.lucene.search.FuzzyTermEnum.<init>(FuzzyTermEnum.java:121)
> at
> org.apache.lucene.search.FuzzyLikeThisQuery.addTerms(FuzzyLikeThisQuery.java:202)
> at
> org.apache.lucene.search.FuzzyLikeThisQuery.rewrite(FuzzyLikeThisQuery.java:261)
> at org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:386)
> at org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:371)
> at org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:386)
> at org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:386)
> at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:272)
> at org.apache.lucene.search.Query.weight(Query.java:100)
> at org.apache.lucene.search.Searcher.createWeight(Searcher.java:147)
> at org.apache.lucene.search.Searcher.search(Searcher.java:49)
>
> This exception usually occurs when one or more3 searches run at the same
> time. I modified the code to check indexReader.refCount before colsing the
> indexSearcher and it seems that the problem disappeared. However, I'm not
> sure that this is the best solution. Do you have any other ideas?
>
> Thanks in advance,
> Ákos Tajti
>

---------------------------------------------------------------------
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