Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Caused by: java.io.IOException: The handle is invalid

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


vnguyen at ur

Sep 25, 2006, 6:10 PM

Post #1 of 5 (1373 views)
Permalink
Caused by: java.io.IOException: The handle is invalid

I'm getting an error while trying to build my index:



Caused by: java.io.IOException: The handle is invalid

at java.io.RandomAccessFile.close0(Native Method)

at java.io.RandomAccessFile.close(RandomAccessFile.java:532)

at
org.apache.lucene.store.FSIndexOutput.close(FSDirectory.java:507)

at
org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:91)

at
org.apache.lucene.index.IndexWriter$4.doBody(IndexWriter.java:726)

at org.apache.lucene.store.Lock$With.run(Lock.java:99)

at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:724)

at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:686)

at
org.apache.lucene.index.IndexWriter.maybeMergeSegments(IndexWriter.java:
674)

at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:479)

at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:462)



I only get this error when using the server version of jvm.dll with my
JBoss app server... but when I use the client version of jvm.dll, the
same index builds just fine.



Has anyone ever experienced this situation?



Van


lucene at mikemccandless

Sep 26, 2006, 6:37 AM

Post #2 of 5 (1264 views)
Permalink
Re: Caused by: java.io.IOException: The handle is invalid [In reply to]

Van Nguyen wrote:

> I only get this error when using the server version of jvm.dll with my
> JBoss app server… but when I use the client version of jvm.dll, the same
> index builds just fine.

This is an odd error. Which OS are you running on? And, what kind of
filesystem is the index directory on?

It's surprising that client vs server JRE causes this.

Is the exception easily reproduced or is it intermittent?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


vnguyen at ur

Sep 26, 2006, 9:31 AM

Post #3 of 5 (1268 views)
Permalink
RE: Caused by: java.io.IOException: The handle is invalid [In reply to]

I'm running this on Windows 2003 server (NTFS). The Java VM version is
1.5.0_06. This exception is not consistent, but it is not intermittent
either. It does not throw it at any particular point while rebuilding
the index, but it will throw this exception at some point (it could be
1/3 way through... or it could be 95% done).

At first... I thought I might have a bad sector somewhere on my hard
drive, so I partitioned a hard drive (known to be good) to be only
500mb... knowing this particular index is only 250mb. Using the server
version of the jvm.dll will cause this error somewhere during program.
Using the client version, it builds w/o any errors.

Van

-----Original Message-----
From: Michael McCandless [mailto:lucene [at] mikemccandless]
Sent: Tuesday, September 26, 2006 6:38 AM
To: java-user [at] lucene
Subject: Re: Caused by: java.io.IOException: The handle is invalid

Van Nguyen wrote:

> I only get this error when using the server version of jvm.dll with my

> JBoss app server... but when I use the client version of jvm.dll, the
same
> index builds just fine.

This is an odd error. Which OS are you running on? And, what kind of
filesystem is the index directory on?

It's surprising that client vs server JRE causes this.

Is the exception easily reproduced or is it intermittent?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


lucene at mikemccandless

Sep 27, 2006, 3:24 PM

Post #4 of 5 (1260 views)
Permalink
Re: Caused by: java.io.IOException: The handle is invalid [In reply to]

Van Nguyen wrote:
> I'm running this on Windows 2003 server (NTFS). The Java VM version is
> 1.5.0_06. This exception is not consistent, but it is not intermittent
> either. It does not throw it at any particular point while rebuilding
> the index, but it will throw this exception at some point (it could be
> 1/3 way through... or it could be 95% done).
>
> At first... I thought I might have a bad sector somewhere on my hard
> drive, so I partitioned a hard drive (known to be good) to be only
> 500mb... knowing this particular index is only 250mb. Using the server
> version of the jvm.dll will cause this error somewhere during program.
> Using the client version, it builds w/o any errors.

I am at a loss on this one.

That function that writes the segments file is quite simple -- it opens
a "segments.new", writes a smallish number of bytes, then closes it,
then renames it to "segments". Your exception happens in the close (in
a finally clause). I don't get why server version of the JRE would do
this but the client version would not.

Do you have any interesting customizations in how you are using Lucene?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


lucene at mikemccandless

Nov 29, 2006, 4:12 PM

Post #5 of 5 (1169 views)
Permalink
Re: Caused by: java.io.IOException: The handle is invalid [In reply to]

Michael McCandless wrote:
> Van Nguyen wrote:
>> I'm running this on Windows 2003 server (NTFS). The Java VM version is
>> 1.5.0_06. This exception is not consistent, but it is not intermittent
>> either. It does not throw it at any particular point while rebuilding
>> the index, but it will throw this exception at some point (it could be
>> 1/3 way through... or it could be 95% done).
>> At first... I thought I might have a bad sector somewhere on my hard
>> drive, so I partitioned a hard drive (known to be good) to be only
>> 500mb... knowing this particular index is only 250mb. Using the server
>> version of the jvm.dll will cause this error somewhere during program.
>> Using the client version, it builds w/o any errors.
>
> I am at a loss on this one.
>
> That function that writes the segments file is quite simple -- it opens
> a "segments.new", writes a smallish number of bytes, then closes it,
> then renames it to "segments". Your exception happens in the close (in
> a finally clause). I don't get why server version of the JRE would do
> this but the client version would not.
>
> Do you have any interesting customizations in how you are using Lucene?
>
> Mike

Hi,

It's been 2 months since this thread, but, in a separate JIRA issue:

http://issues.apache.org/jira/browse/LUCENE-669

We see an IOException very similar to the one at the start of this
thread. It's due to a bug in Lucene (and we believe also a bug in the
JVM -- but this is sort of speculation) where Lucene is closing an
already closed RandomAccessFile in a finalize() method.

Anyway, Van, if you are still here then you may want to test the patch
on that issue above (just committed to the trunk version of Lucene) to
see if it fixes your issue!

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.