-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: [Search]IndexReader exception while searching.
PostPosted: Wed Apr 23, 2008 3:24 pm 
Newbie

Joined: Wed Feb 20, 2008 6:42 pm
Posts: 14
Hi,
I am using Hibernate Search for a while. I have a dedicated server which continuously does the indexing and writes to a shared directory on a unix box. My jboss runs on a separate box and have access to the indexes directory.

Every thing is fine, and am able to search also, and the performance is reasonably ok. But if I search for some 10 - 30 times repeatedly I am getting this exception :
Code:
javax.persistence.PersistenceException: org.hibernate.search.SearchException: Unable to close Lucene IndexReader
   at org.hibernate.search.jpa.impl.FullTextQueryImpl.throwPersistenceException(FullTextQueryImpl.java:128)
   at org.hibernate.search.jpa.impl.FullTextQueryImpl.getResultList(FullTextQueryImpl.java:96)
   at com.sonymusic.aoma.search.lucene.ui.LuceneSearchAction.searchAndPopulatePage(LuceneSearchAction.java:190)
   at com.sonymusic.aoma.search.lucene.ui.LuceneSearchAction.doAction(LuceneSearchAction.java:157)
   at com.sonymusic.aoma.dispatcher.actions.SimpleDispatcherAction.executeAction(SimpleDispatcherAction.java:388)
   at com.sonymusic.aoma.dispatcher.DispatcherAction.execute(DispatcherAction.java:134)
   at com.sonymusic.aoma.dispatcher.DispatcherServlet.doChain(DispatcherServlet.java:119)
   at com.sonymusic.aoma.dispatcher.DispatcherServlet.doChain(DispatcherServlet.java:97)
   at com.sonymusic.aoma.dispatcher.DispatcherServlet.service(DispatcherServlet.java:85)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
   at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.search.SearchException: Unable to close Lucene IndexReader
   at org.hibernate.search.reader.SharedReaderProvider.replaceActiveReader(SharedReaderProvider.java:190)
   at org.hibernate.search.reader.SharedReaderProvider.openReader(SharedReaderProvider.java:92)
   at org.hibernate.search.query.FullTextQueryImpl.buildSearcher(FullTextQueryImpl.java:454)
   at org.hibernate.search.query.FullTextQueryImpl.list(FullTextQueryImpl.java:228)
   at org.hibernate.search.jpa.impl.FullTextQueryImpl.getResultList(FullTextQueryImpl.java:85)
   ... 26 more
Caused by: java.io.IOException: Stale NFS file handle
   at java.io.RandomAccessFile.close0(Native Method)
   at java.io.RandomAccessFile.close(RandomAccessFile.java:532)
   at org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor.close(FSDirectory.java:514)
   at org.apache.lucene.store.FSDirectory$FSIndexInput.close(FSDirectory.java:561)
   at org.apache.lucene.index.SegmentReader.closeNorms(SegmentReader.java:540)
   at org.apache.lucene.index.SegmentReader.doClose(SegmentReader.java:269)
   at org.apache.lucene.index.IndexReader.close(IndexReader.java:842)
   at org.apache.lucene.index.MultiReader.doClose(MultiReader.java:255)
   at org.apache.lucene.index.IndexReader.close(IndexReader.java:842)
   at org.hibernate.search.reader.SharedReaderProvider.replaceActiveReader(SharedReaderProvider.java:187)


Anybody know, whats wrong here ? I left the IndexReader as default only which means its shared. Any help is highly appreciated.

thanks
Anil.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 4:37 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
the problem is the NFS file system: look at this javadoc:
http://lucene.apache.org/java/2_3_0/api/org/apache/lucene/index/IndexWriter.html

The simplest solution is to avoid NFS; would that be possible in your scenario?

regards,

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:01 pm 
Newbie

Joined: Wed Feb 20, 2008 6:42 pm
Posts: 14
Hi grinovero,
Thanks a lot, for the quick response.
I am afraid, this is totally not possible in my case. But the interesting thing is, I have only one writer per entity class. I still dont know why this contention should happen. Any ideas ?

thanks
Anil.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:54 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
this is not a contention problem, it appears that some file has been deleted on the remote server while still needed by an IndexSearcher.
This is normal behaviour: Lucene works this way; normally on local filesystems it asks OS to not really delete the file until the last IndexSearcher is closed; this is not supported on NFS so its request is ignored.

To solve this is quite simple: instead of using NFS you should configure Hibernate Search to use the "JMS Master/Slave configuration" (look at reference docs). This configuration has been created exactly for this type of scenario.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.