-->
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.  [ 9 posts ] 
Author Message
 Post subject: index reader
PostPosted: Thu Aug 13, 2009 7:09 am 
Newbie

Joined: Mon Feb 09, 2009 9:40 am
Posts: 15
how to resolve index reader already closed exception??? please help me .... waiting for your reply......


org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed
org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:196)
org.apache.lucene.index.DirectoryIndexReader.reopen(DirectoryIndexReader.java:143)
org.hibernate.search.reader.SharingBufferReaderProvider$PerDirectoryLatestReader.refreshAndGet(SharingBufferReaderProvider.java:242)
org.hibernate.search.reader.SharingBufferReaderProvider.openReader(SharingBufferReaderProvider.java:123)
org.hibernate.search.query.FullTextQueryImpl.buildSearcher(FullTextQueryImpl.java:718)
org.hibernate.search.query.FullTextQueryImpl.getResultSize(FullTextQueryImpl.java:760)
com.movie.search.testsearcher.search1(testsearcher.java:114)
com.movie.search.helper.SearchHelper.execute(SearchHelper.java:59)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.20</h3></body></html>


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 7:44 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
This is most likely caused by some misuse of the IndexReader.
How are you using it? Like http://docs.jboss.org/hibernate/stable/search/reference/en/html/ch08s03.html ?
Which ReaderProvider are you using (configuration option "hibernate.search.reader.strategy")? the choice of the ReaderProvider affects the way Search manages the lifecycle of the IndexReaders.
Could you show a stacktrace?

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


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 7:46 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Which ReaderProvider are you using (configuration option "hibernate.search.reader.strategy")? the choice of the ReaderProvider affects the way Search manages the lifecycle of the IndexReaders.
Could you show a stacktrace?

Sorry this questions are not relevant, somehow my mobile browser had decided to hide the stacktrace.

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


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 8:01 am 
Newbie

Joined: Mon Feb 09, 2009 9:40 am
Posts: 15
Hi ..
Thanx for your reply.i used FSdierectory provider...


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 9:55 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Are you using Lucene 2.4.1 ?
Since 2.4.0 some problems about this were solved:
http://issues.apache.org/jira/browse/LUCENE-1453
http://issues.apache.org/jira/browse/LUCENE-1430

You are probably experiencing some IOException which gets hidden by Lucene (readonly file, wrong permissions, indexcorrupted..).
Try upgrading Lucene.

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


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 9:58 am 
Newbie

Joined: Mon Feb 09, 2009 9:40 am
Posts: 15
yes i am using lucene 2.4.1


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Thu Aug 13, 2009 10:07 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
try setting
Code:
hibernate.search.reader.strategy=not-shared
,
this will avoid the "DirectoryIndexReader.reopen" and possibly uncover another exception., maybe you found another bug not yet solved from the same family.

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


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Fri Aug 14, 2009 6:36 am 
Newbie

Joined: Mon Feb 09, 2009 9:40 am
Posts: 15
i tried it ....i am getting the same exception....

this is my search code
public List search1(String name1,String scat,String cat,int pageNumber)

{

//indexWithHibernate();

//createSomeArticles();
Session session = HibernateUtil.currentSession();
System.out.println("i am in method"+session);
fSession = Search.getFullTextSession(session);
System.out.println("Session test"+fSession);
fSession.beginTransaction();

// create a parser to parse a full text query
QueryParser parser = new QueryParser("name", new StandardAnalyzer());
int id=Integer.parseInt(cat);
System.out.println("parser"+parser);

try {
lucenceQuery = parser.parse(scat+":"+name1+"*"+" OR catpojo.id :"+id);
System.out.println(lucenceQuery);
} catch (ParseException e) {
throw new RuntimeException("Cannot search with query string",e);
}




System.out.println(lucenceQuery+ " "+fSession);
FullTextQuery fp=fSession.createFullTextQuery(lucenceQuery,MovieMasterPojo.class);System.out.println(" size1"+fp.getResultSize());
/////////here only i am getting problem...
fp.setFirstResult(pageSize * (pageNumber - 1)) ;
fp.setMaxResults(pageSize) ;

this.setTotal(fp.getResultSize());
List<MovieMasterPojo> articles = fp.list();
fSession.getTransaction().commit();
System.out.println(" size2"+articles.size());
return articles;
}


Top
 Profile  
 
 Post subject: Re: index reader
PostPosted: Sat Aug 15, 2009 2:54 pm 
Newbie

Joined: Sat Aug 15, 2009 2:16 pm
Posts: 1
Deletes the document numbered doc_num. Once a document is deleted it will not appear in TermDocEnum or TermPostitions enumerations. Attempts to read its field with the @link documentend method will result in an error. The presence of this document may still be reflected in the @link docFreqendstatistic, though this will be corrected eventually as the index is further modified.
Ab-circle-pro


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.