14 Replies Latest reply on Feb 25, 2009 8:55 PM by Romain Cherchi

    Hibernate search : Indexing a 1 million rows table.

    Romain Cherchi Newbie

      Hi guys,


      I'm using JBoss Seam 2.1.1.CR1. I'm trying to index a large table (up to 1 million rows) using Hibernate search version:3.0.0 GA.


      I read the instructions in the hibernate manual (Chapter 6. Manual indexing) :


      fullTextSession.setFlushMode(FlushMode.MANUAL);
      fullTextSession.setCacheMode(CacheMode.IGNORE);
      transaction = fullTextSession.beginTransaction();
      //Scrollable results will avoid loading too many objects in memory
      ScrollableResults results = fullTextSession.createCriteria( Email.class ).scroll( ScrollMode.FORWARD_ONLY );
      int index = 0;
      while( results.next() ) {
          index++;
          fullTextSession.index( results.get(0) ); //index each element
          if (index % batchSize == 0) s.clear(); //clear every batchSize since the queue is processed
      }
      transaction.commit();



      but I can't figure out how I can use this with JPA. I have a FullTextEntityManager (no fullTextSession).


      Thanks for you help.


        • 1. Re: Hibernate search : Indexing a 1 million rows table.
          Romain Cherchi Newbie

          OK, I got it. fullTextSession can be accessed using


          @PersistenceContext
          private EntityManager em;
          
          [...]
          
          org.hibernate.search.FullTextSession fullTextSession = (org.hibernate.search.FullTextSession)em.getDelegate();
          
          



          However, I still have an OutOfMemory Exception :(



          16:49:23,346 INFO  [STDOUT] before scrolling...
          16:50:21,782 ERROR [STDERR] Exception in thread "Timer-0"
          16:50:22,303 WARN  [TxConnectionManager] Connection error occured: org.jboss.res
          ource.connectionmanager.TxConnectionManager$TxConnectionEventListener@363bce[sta
          te=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@15b453
          5 handles=1 lastUse=1230047332215 permit=true trackByTx=true mcp=org.jboss.resou
          rce.connectionmanager.JBossManagedConnectionPool$OnePool@11cb6f7 context=org.jbo
          ss.resource.connectionmanager.InternalManagedConnectionPool@3037a0 xaResource=or
          g.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@14115fb t
          xSync=null]
          javax.resource.spi.ResourceAdapterInternalException: Unexpected error
                  at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.broadcas
          tConnectionError(BaseWrapperManagedConnection.java:393)
                  at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.connecti
          onError(BaseWrapperManagedConnection.java:370)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkException(Wrap
          pedConnection.java:865)
                  at org.jboss.resource.adapter.jdbc.WrappedStatement.checkException(Wrapp
          edStatement.java:852)
                  at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery
          (WrappedPreparedStatement.java:347)
                  at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
          186)
                  at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
                  at org.hibernate.loader.Loader.scroll(Loader.java:2293)
                  at org.hibernate.loader.criteria.CriteriaLoader.scroll(CriteriaLoader.ja
          va:89)
                  at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1533)
                  at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
                  at com.easycity.ejb.pages.IndexManagerBean.init(IndexManagerBean.java:24
          6)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:112)
                  at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
          ntextImpl.java:166)
                  at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationCo
          ntext.java:44)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:56)
                  at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackI
          nterceptor.java:28)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterc
          eptor.java:77)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodConte
          xtInterceptor.java:44)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke
          (EntityManagerProxyInterceptor.java:29)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInv
          oke(HibernateSessionProxyInterceptor.java:31)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
          107)
                  at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionB
          eanInterceptor.java:50)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
          ntextImpl.java:118)
                  at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int
          erceptorsInterceptor.java:63)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationIntercepto
          r.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok
          e(TransactionScopedEntityManagerInterceptor.java:54)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI
          nterceptor.java:47)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                  at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
          :195)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
          erceptor.java:95)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
          stanceInterceptor.java:83)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
          ationInterceptor.java:77)
                  at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
          enticationInterceptor.java:110)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
          ptor.java:46)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
          usInterceptor.java:106)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
          java:101)
                  at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContain
          er.java:206)
                  at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.
          java:119)
                  at $Proxy152.init(Unknown Source)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                  at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
          Context.java:31)
                  at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideIn
          terceptor.java:76)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:56)
                  at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.j
          ava:43)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(Synchroni
          zationInterceptor.java:32)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
          Context.java:68)
                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
          107)
                  at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInter
          ceptor.java:54)
                  at org.javassist.tmp.java.lang.Object_$$_javassist_2.init(Object_$$_java
          ssist_2.java)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329
          )
                  at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342
          )
                  at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:5
          8)
                  at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                  at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:27
          6)
                  at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
                  at org.jboss.seam.navigation.Page.preRender(Page.java:293)
                  at org.jboss.seam.navigation.Pages.preRender(Pages.java:366)
                  at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.
          java:562)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseLi
          stener.java:473)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseList
          ener.java:146)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.ja
          va:116)
                  at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
                  at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.j
          ava:176)
                  at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:14
          5)
                  at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewri
          ter.java:92)
                  at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewrit
          eFilter.java:381)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
          atcher.java:654)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
          tionDispatcher.java:445)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
          ispatcher.java:379)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
          patcher.java:292)
                  at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
                  at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:73)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
          
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFil
          ter.java:380)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
          .java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
                  at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.j
          ava:176)
                  at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:14
          5)
                  at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewri
          ter.java:92)
                  at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewrit
          eFilter.java:381)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
          lter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
          icationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
          ilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
          alve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
          alve.java:175)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
          yAssociationValve.java:182)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
          torBase.java:432)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
          e.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
          ava:127)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
          ava:102)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
          onnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
          ve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
          a:262)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
          :844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
          ss(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
          6)
                  at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.OutOfMemoryError: Java heap space
          16:50:22,304 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
          16:50:22,366 ERROR [STDERR]     at org.jboss.net.protocol.resource.Handler.openC
          onnection(Handler.java:43)
          16:50:22,367 ERROR [STDERR]     at java.net.URL.openConnection(URL.java:943)
          16:50:22,367 ERROR [STDERR]     at org.jboss.logging.Log4jService$URLWatchTimerT
          ask.run(Log4jService.java:569)
          16:50:22,368 ERROR [STDERR]     at java.util.TimerThread.mainLoop(Timer.java:512
          )
          16:50:22,368 ERROR [STDERR]     at java.util.TimerThread.run(Timer.java:462)
          
          



          • 2. Re: Hibernate search : Indexing a 1 million rows table.
            Romain Cherchi Newbie

            after some improvements... (It worked with another table with 60 000 rows)



            @Stateless
            public class HibernateSearchManagerBean implements HibernateSearchManagerLocal {     
                 private EntityManager em;
                 private final int BATCH_SIZE = 25;
                 
                 public HibernateSearchManagerBean(EntityManager em) {
                      this.em = em;
                 }
                 
                 public void buildLuceneIndex(Class entityClass) {
                      org.hibernate.search.FullTextSession fullTextSession = (org.hibernate.search.FullTextSession)em.getDelegate();
                      fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
                      fullTextSession.setCacheMode(CacheMode.IGNORE);
                      
                      org.hibernate.Transaction transaction = fullTextSession.beginTransaction();
                      //Scrollable results will avoid loading too many objects in memory
                      
                      System.out.println("before scrolling...");
                      org.hibernate.ScrollableResults results = fullTextSession.createCriteria(entityClass).setFetchSize(BATCH_SIZE).scroll(org.hibernate.ScrollMode.FORWARD_ONLY);
                      System.out.println("hello ?");
                      int index = 0;
                      while( results.next() ) {
                          index++;
                          fullTextSession.index( results.get(0) ); //index each element
                          if (index % BATCH_SIZE  == 0) {
                               System.out.println("------------> clear : " + index);
                               fullTextSession.clear(); //clear every batchSize since the queue is processed
                          }
                      }
                      transaction.commit();
            
                      try {
                          if (results != null) results.close();
                      } catch (Exception ex) {
                          ex.printStackTrace();
                      }
                 }
            }
            




            but I'm still getting an error in the middle of the process for the 1 million rows table :


            2008-12-23 21:30:23,573 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id -3f57fec0:c167:495148af:33 invoked while multiple threads active within it.
            2008-12-23 21:30:23,574 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action -3f57fec0:c167:495148af:33 aborting with 1 threads active!
            2008-12-23 21:30:23,580 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
            2008-12-23 21:30:23,580 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
            2008-12-23 21:30:23,580 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
            2008-12-23 21:30:23,580 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
            2008-12-23 21:30:23,601 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not advance using next() [???]
            java.sql.SQLException: The result set is closed.
                 at org.jboss.resource.adapter.jdbc.WrappedResultSet.checkState(WrappedResultSet.java:1959)
                 at org.jboss.resource.adapter.jdbc.WrappedResultSet.next(WrappedResultSet.java:1193)
                 at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:99)
                 at com.easycity.ejb.services.util.HibernateSearchManagerBean.buildLuceneIndex(HibernateSearchManagerBean.java:48)
                 at com.easycity.ejb.pages.IndexManagerBean.init(IndexManagerBean.java:157)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                 at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                 at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                 at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                 at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                 at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                 at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                 at $Proxy152.init(Unknown Source)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                 at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                 at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                 at org.javassist.tmp.java.lang.Object_$$_javassist_2.init(Object_$$_javassist_2.java)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                 at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                 at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                 at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                 at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                 at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
                 at org.jboss.seam.navigation.Page.preRender(Page.java:293)
                 at org.jboss.seam.navigation.Pages.preRender(Pages.java:366)
                 at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
                 at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
                 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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
                 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
                 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
                 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
                 at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
                 at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                 at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                 at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 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:182)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 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.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Thread.java:595)
            2008-12-23 21:30:23,604 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
            2008-12-23 21:30:23,605 ERROR [org.hibernate.util.JDBCExceptionReporter] The result set is closed.
            2008-12-23 21:30:23,614 ERROR [STDERR] org.hibernate.exception.GenericJDBCException: could not advance using next()
                 at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
                 at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:104)
                 at com.easycity.ejb.services.util.HibernateSearchManagerBean.buildLuceneIndex(HibernateSearchManagerBean.java:48)
                 at com.easycity.ejb.pages.IndexManagerBean.init(IndexManagerBean.java:157)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                 at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                 at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                 at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                 at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                 at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                 at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                 at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                 at $Proxy152.init(Unknown Source)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                 at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                 at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                 at org.javassist.tmp.java.lang.Object_$$_javassist_2.init(Object_$$_javassist_2.java)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                 at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                 at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                 at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                 at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                 at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
                 at org.jboss.seam.navigation.Page.preRender(Page.java:293)
                 at org.jboss.seam.navigation.Pages.preRender(Pages.java:366)
                 at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
                 at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
                 at org.tuckey.web.filters.urlrewrite.RuleChain
            2008-12-23 21:30:23,660 ERROR [STDERR] .doRules(RuleChain.java:145)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
                 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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
                 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
                 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
                 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
                 at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
                 at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                 at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                 at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
                 at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 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:182)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 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.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Thread.java:595)
            Caused by: java.sql.SQLException: The result set is closed.
                 at org.jboss.resource.adapter.jdbc.WrappedResultSet.checkState(WrappedResultSet.java:1959)
                 at org.jboss.resource.adapter.jdbc.WrappedResultSet.next(WrappedResultSet.java:1193)
                 at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:99)
                 ... 143 more
            2008-12-23 21:30:23,696 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] No navigation rule found for null outcome and viewId /index.xhtml Explicitly remain on the current view 
            2008-12-23 21:30:23,698 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] rolling back transaction after invoking page actions
            2008-12-23 21:30:23,698 DEBUG [org.jboss.seam.transaction.UTTransaction] rolling back JTA transaction
            2008-12-23 21:30:23,698 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_40] - Abort called on already aborted atomic action -3f57fec0:c167:495148af:33
            2008-12-23 21:30:23,732 DEBUG [org.jboss.seam.exception.Exceptions] reading exception mappings from /WEB-INF/pages.xml
            2008-12-23 21:30:23,763 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@820d53, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@f2e78{ url=null ,addedOrder=0}
            2008-12-23 21:30:23,764 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@820d53, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@b3e508{ url=null ,addedOrder=0}
            2008-12-23 21:30:23,797 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@820d53, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@81a7f9{ url=null ,addedOrder=0}
            2008-12-23 21:30:23,807 DEBUG [org.jboss.seam.faces.Navigator] redirecting to: /error.xhtml
            




            • 3. Re: Hibernate search : Indexing a 1 million rows table.
              Tomaz Cerar Master

              Hi,


              the problem is that transaction in which you are running has timed out.


              I don't know the proper solution for this but if you increase transaction timeout in jboss-service.xml (conf folder) from default 300 seconds to something more(in your case probably double that) it will work.
              But this will change transaction timeout for all transactions in all applications running on that jboss. That is probably not ok...


              The real question is, how to increase transaction timeout just for one component(ejb or pojo) or just for one method. That is something that I would like to know also.



              cheers,
              tomaz

              • 4. Re: Hibernate search : Indexing a 1 million rows table.
                Vladimir Kovalyuk Apprentice

                Show me the formula how you're going to calculate the timeout value for the particular case. It depends on so many things ...


                I believe you should avoid use of transaction in such a case. (use NOT_SUPPORTED attribute). First off try asynchronous methods.

                • 5. Re: Hibernate search : Indexing a 1 million rows table.
                  Ronald van Kuijk Apprentice

                  Vladimir Kovalyuk wrote on Dec 23, 2008 23:53:


                  I believe you should avoid use of transaction in such a case. (use NOT_SUPPORTED attribute). First off try asynchronous methods.



                  exactly and not from a web-request.... http timeouts etc...


                  And try batches.....

                  • 6. Re: Hibernate search : Indexing a 1 million rows table.
                    Romain Cherchi Newbie

                    Thank you guys and best wishes for 2009 !


                    Here is my current working implementation (using a ScopeType.APPLICATION - so the index gets created at boot time) :


                    As Tomaz suggested, I still have to change the transaction timeout in jboss-service.xml but it's not a big deal since I only have to create the index one time. Then I can set this value back to the orignal version. I also tried to create a client console to launch this but I don't really know how I can access my project ejb and other seam components with a console (probably using @Remote)... I tried to remove the transcation and asynchronous but I got an exception in both cases (didn't try to fix it very much).


                    Please let me know if you find out a better way to do it.


                    
                    /**
                     * Re index the needed entities
                     * 
                     * @author Emmanuel Bernard, Romain Cherchi
                     */
                    @Name("indexer")
                    @Stateful
                    @Scope(ScopeType.APPLICATION)
                    @Startup
                    public class IndexerBean implements IndexerLocal {
                         private Date lastIndexingTime;
                    
                         @PersistenceContext
                         private EntityManager em;
                    
                         private final int BATCH_SIZE = 100;
                    
                         public Date getLastIndexingTime() {
                              return lastIndexingTime;
                         }
                    
                         @Create
                         public void index() {
                              PropertiesManagerBean propertiesManager = new PropertiesManagerBean();
                    
                              if (propertiesManager.getLuceneCreateIndexes()) {
                                   indexAllClasses(        POI.class
                                                            , Mb.class
                                                            , LocalBusinessOwner.class
                                                            , Message.class
                                                            );
                                   
                                   lastIndexingTime = new Date();
                              } else {
                                   System.out.println("Lucene index not recreated (on purpose).");
                              }
                         }
                    
                         private FullTextSession getFullTextSession() {
                              return (FullTextSession) em.getDelegate();
                         }
                    
                         @SuppressWarnings("unchecked")
                         private void indexAllClasses(Class... entityTypes) {
                              FullTextSession fullTextSession = getFullTextSession();
                              fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
                              fullTextSession.setCacheMode(CacheMode.IGNORE);
                    
                              for (Class entityType : entityTypes) {
                    
                                   org.hibernate.Transaction transaction = fullTextSession
                                             .beginTransaction();
                                   // Scrollable results will avoid loading too many objects in memory
                    
                                   org.hibernate.ScrollableResults results = fullTextSession
                                             .createCriteria(entityType).setFetchSize(BATCH_SIZE)
                                             .scroll(org.hibernate.ScrollMode.FORWARD_ONLY);
                                   int index = 0;
                                   while (results.next()) {
                                        index++;
                                        fullTextSession.index(results.get(0)); // index each element
                                        if (index % BATCH_SIZE == 0) {
                                             System.out.println("...indexing "
                                                       + entityType.getSimpleName() + ": " + index);
                                             fullTextSession.clear(); // clear every batchSize since the
                                             // queue is processed
                                        }
                                   }
                                   transaction.commit();
                    
                                   try {
                                        if (results != null)
                                             results.close();
                                   } catch (Exception ex) {
                                        ex.printStackTrace();
                                   }
                              }
                         }
                    
                         @Remove
                         @Destroy
                         public void stop() {
                         }
                    
                    }
                    
                    


                    • 7. Re: Hibernate search : Indexing a 1 million rows table.
                      S T Newbie

                      Hi,


                      I just stole your code in hope that I won't get the error I already had with an other solution...
                      I always get a class cast exception:



                      Caused by: java.lang.ClassCastException: org.jboss.seam.persistence.FullTextHibernateSessionProxy cannot be cast to org.hibernate.impl.SessionImpl


                      Do you have an idea why?
                      I just copy pasted you code in my class which has the same name and implemts the Interface:



                      @Local
                      public interface IndexerLocal {

                           public void index();
                      }


                      Bests,
                      Sushi

                      • 8. Re: Hibernate search : Indexing a 1 million rows table.
                        Romain Cherchi Newbie

                        Hello !


                        This is my corrent working implementation.


                        @Name("indexer")
                        @Stateful
                        @Scope(ScopeType.APPLICATION)
                        @Startup
                        public class IndexerBean implements IndexerLocal {
                             private Date lastIndexingTime;
                        
                             @PersistenceContext(type=PersistenceContextType.EXTENDED)
                             private EntityManager em;
                        
                             private final int BATCH_SIZE = 1000;
                             private final int FETCH_SIZE = 100;
                        
                             public Date getLastIndexingTime() {
                                  return lastIndexingTime;
                             }
                        
                             @Create
                             public void index() {
                                  PropertiesManagerBean propertiesManager = new PropertiesManagerBean();
                        
                                  if (propertiesManager.getLuceneCreateIndexes()) {
                                       indexAllLargeClasses(Mb.class);
                                       
                                       indexPOI();
                        
                                       indexAllSmallClasses(       Message.class
                                                                     , LocalBusinessOwner.class
                                                                     );
                                       
                                       indexLargeClass(City.class);
                        
                                       indexLargeClass(StatsSearch.class);
                                       
                                       lastIndexingTime = new Date();
                        
                                       System.out.println("Last indexing time : "
                                                 + lastIndexingTime.toString());
                                  } else {
                                       System.out.println("Lucene index not recreated (on purpose).");
                                  }
                             }
                             
                             private void indexPOI() {
                                  FullTextSession fullTextSession = getFullTextSession();
                                  
                                  /*
                                  fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
                                  fullTextSession.setCacheMode(CacheMode.IGNORE);
                                  */
                                  
                                  org.hibernate.Transaction transaction = fullTextSession
                                            .beginTransaction();
                                  /*
                                  // Scrollable results will avoid loading too many objects in memory
                                  org.hibernate.ScrollableResults results = fullTextSession
                                  .createCriteria(POI.class).setFetchSize(BATCH_SIZE)
                                  .setFetchMode("detailsSet", org.hibernate.FetchMode.JOIN)
                                  .setFetchMode("reviewSet", org.hibernate.FetchMode.JOIN)
                                  .scroll(org.hibernate.ScrollMode.FORWARD_ONLY);
                                  */
                                   org.hibernate.Criteria query = fullTextSession
                                            .createCriteria(POI.class)
                                            .setFetchMode("detailsSet", org.hibernate.FetchMode.JOIN)
                                            .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
                                            .setCacheMode(CacheMode.IGNORE)
                                            .setFetchSize(FETCH_SIZE)
                                            .setFlushMode(org.hibernate.FlushMode.MANUAL);
                                   
                                   query.setFetchMode("reviewSet", org.hibernate.FetchMode.JOIN)
                                       .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
                                       .setCacheMode(CacheMode.IGNORE)
                                       .setFetchSize(FETCH_SIZE)
                                       .setFlushMode(org.hibernate.FlushMode.MANUAL);
                                   
                                   query.setFetchMode("businessOwner", org.hibernate.FetchMode.JOIN)
                                       .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
                                       .setCacheMode(CacheMode.IGNORE)
                                       .setFetchSize(FETCH_SIZE)
                                       .setFlushMode(org.hibernate.FlushMode.MANUAL);
                                   
                                   query.setFetchMode("mainCategory", org.hibernate.FetchMode.JOIN)
                                       .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
                                       .setCacheMode(CacheMode.IGNORE)
                                       .setFetchSize(FETCH_SIZE)
                                       .setFlushMode(org.hibernate.FlushMode.MANUAL);
                                   
                                   query.setFetchMode("mainCategory.detailsSet", org.hibernate.FetchMode.JOIN)
                                       .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
                                       .setCacheMode(CacheMode.IGNORE)
                                       .setFetchSize(FETCH_SIZE)
                                       .setFlushMode(org.hibernate.FlushMode.MANUAL);
                                   
                                  org.hibernate.ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);
                                   
                                  int index = 0;
                                  while (results.next()) {
                                       index++;
                                       fullTextSession.index(results.get(0)); // index each element
                                       if (index % BATCH_SIZE == 0) {
                                            System.out.println("...indexing POI : " + index);
                                            fullTextSession.clear(); // clear every batchSize since the
                                            // queue is processed
                                       }
                                  }
                                  transaction.commit();
                        
                                  try {
                                       if (results != null) {
                                            results.close();
                                       }
                                  } catch (Exception ex) {
                                       ex.printStackTrace();
                                  }
                             }
                             
                             private FullTextSession getFullTextSession() {
                                  return (FullTextSession) em.getDelegate();
                             }
                        
                             @SuppressWarnings("unchecked")
                             private void indexAllSmallClasses(Class... entityTypes) {
                                  FullTextSession fullTextSession = getFullTextSession();
                                  for (Class entityType : entityTypes) {
                                       System.out.println("...indexing " + entityType.getSimpleName());
                                       for (Object obj : fullTextSession.createCriteria(entityType).list()) {
                                            fullTextSession.index(obj);
                                       }
                                  }
                             }
                        
                             @SuppressWarnings("unchecked")
                             private void indexLargeClass(Class entityType) {
                                  FullTextSession fullTextSession = getFullTextSession();
                                  
                                  fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);      // Disable flush operations
                                  fullTextSession.setCacheMode(CacheMode.IGNORE);                         // Disable 2nd-level cache operations
                        
                                  org.hibernate.Transaction transaction = fullTextSession
                                            .beginTransaction();
                                  // Scrollable results will avoid loading too many objects in memory
                        
                                  org.hibernate.ScrollableResults results = fullTextSession
                                            .createCriteria(entityType).setFetchSize(BATCH_SIZE).scroll(
                                                      org.hibernate.ScrollMode.FORWARD_ONLY);           // Ensure forward only result set
                                  int index = 0;
                                  while (results.next()) {
                                       index++;
                                       fullTextSession.index(results.get(0)); // index entities
                                       if (index % BATCH_SIZE == 0) {
                                            System.out.println("...indexing " + entityType.getSimpleName()
                                                      + ": " + index);
                                            fullTextSession.clear(); // Clear the session releasing memory
                                       }
                                  }
                                  transaction.commit(); // Apply the remaining index changes
                        
                                  try {
                                       if (results != null)
                                            results.close();
                                  } catch (Exception ex) {
                                       ex.printStackTrace();
                                  }
                             }
                             
                             @SuppressWarnings("unchecked")
                             private void indexAllLargeClasses(Class... entityTypes) {
                                  FullTextSession fullTextSession = getFullTextSession();
                                  fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
                                  fullTextSession.setCacheMode(CacheMode.IGNORE);
                        
                                  org.hibernate.Transaction transaction = fullTextSession
                                            .beginTransaction();
                                  // Scrollable results will avoid loading too many objects in memory
                        
                                  for (Class entityType : entityTypes) {
                                       org.hibernate.ScrollableResults results = fullTextSession
                                                 .createCriteria(entityType).setFetchSize(BATCH_SIZE).scroll(
                                                           org.hibernate.ScrollMode.FORWARD_ONLY);
                                       int index = 0;
                                       while (results.next()) {
                                            index++;
                                            fullTextSession.index(results.get(0)); // index each element
                                            if (index % BATCH_SIZE == 0) {
                                                 System.out.println("...indexing " + entityType.getSimpleName()
                                                           + ": " + index);
                                                 fullTextSession.clear(); // clear every batchSize since the
                                                 // queue is processed
                                            }
                                       }
                                       
                                       try {
                                            if (results != null) {
                                                 results.close();
                                            }
                                       } catch (Exception ex) {
                                            ex.printStackTrace();
                                       }
                                  }
                                  transaction.commit();
                             }
                        
                             @Remove
                             @Destroy
                             public void stop() {
                             }
                        
                        }




                        I hope it will help.


                        Best,


                        Romain

                        • 9. Re: Hibernate search : Indexing a 1 million rows table.
                          S T Newbie

                          Hi,


                          first of all thanks for the current code.
                          But still I get the same error:



                          Caused by: java.lang.ClassCastException: org.jboss.seam.persistence.HibernateSessionProxy cannot be cast to org.hibernate.search.FullTextSession
                               at de.l3s.vifachem.portalreloaded.session.IndexerBean.getFullTextSession(IndexerBean.java:44)
                               at de.l3s.vifachem.portalreloaded.session.IndexerBean.indexAllClasses(IndexerBean.java:49)
                               at de.l3s.vifachem.portalreloaded.session.IndexerBean.index(IndexerBean.java:39)


                          This means it is in your getFullTextSession method where you cast from javax.persistence.EntityManager to org.hibernate.search.FullTextSession.
                          Or am i using the wrong classes?


                          Bests,
                          Sascha

                          • 10. Re: Hibernate search : Indexing a 1 million rows table.
                            Romain Cherchi Newbie

                            I guess you are using the right classes.


                            I use :


                            org.hibernate.search.FullTextSession
                            and
                            javax.persistence.EntityManager


                            too :-/

                            • 11. Re: Hibernate search : Indexing a 1 million rows table.
                              S T Newbie

                              Ok,


                              so the only difference are my Seam Version (2.0.2.SP1) and Hibenrate Search 3.1.0.GA....


                              Thanks and Bests,
                              Sushi

                              • 13. Re: Hibernate search : Indexing a 1 million rows table.
                                S T Newbie

                                So I figured out the problem!
                                It was a version conflict between the Hibernate delivered with JBoss Server and the newest Hibernate Search etc. I used!
                                So the problem is solved now!