lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peck, Jason" <>
Subject ArrayIndexOutOfBounds exception with >2000 files
Date Tue, 30 Oct 2001 20:54:55 GMT
Has anybody gotten the following exception when trying to search an index
with a large number of files (>2000)?

    [junit] java.lang.ArrayIndexOutOfBoundsException
    [junit]     at java.lang.System.arraycopy(Native Method)
    [junit]     at Source)
    [junit]     at
    [junit]     at org.apache.lucene.index.SegmentReader.norms(Unknown
    [junit]     at org.apache.lucene.index.SegmentReader.norms(Unknown
    [junit]     at Source)
    [junit]     at
    [junit]     at Source)
    [junit]     at
    [junit]     at Source)
    [junit]     at<init>(Unknown Source)
    [junit]     at Source)
    [junit]     at Source)
    [junit]     at

As you can see I am using the RAMDirectory as the storage for my index.  The
following code is used to search the index for the keyword provided:

            Searcher searcher = new IndexSearcher(m_index);   
            Analyzer analyzer = new StopAnalyzer();
            Query query = QueryParser.parse(exp, IndexedFile.KEYWORD_FIELD,
            Hits hits =;

The exception is thrown from the method.  I did a little
bit of research and found that in the RAMInputStream.readInternal() method
it is trying to read (6218 - 1024) bytes from the second buffer in the
RAMFile object.  Well the buffer size is only 1024 so the exception is
thrown.  It looks like it was assumed that any RAMFile object will have at
most 2 buffers (ie. max 2048 bytes).  Another peculiar piece of information
is that that 6218 number just so happens to be the exact number of files
that I indexed.

Any help would be greatly appreciated.

Jason Peck
Senior Software Engineer

McKesson Health Solutions Group
335 Interlocken Parkway
Broomfield, CO 80021
(303) 664-6359

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and may contain confidential 
and privileged information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 

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

View raw message