Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-13468

LuceneIndexer should not stop calling indexers for the different portlets, if one of them throws an exception

    Details

      Description

      In the LuceneIndexer.doReIndex Method, there is a try/catch block around the loop that iterates over the portlets. Therefore, if one of the portet-indexers throws an exception, following portlet-indexers will not be called. The try/catch block should be moved inside the loop, so that the LuceneIndexer continues with the next portlet-indexer, if one of them throws an exception.

      In my case the exception was this:

      2010-10-26 12:45:42,096 ERROR [com.liferay.portal.search.lucene.LuceneIndexer] (http-127.0.0.1-8080-1) Error encountered while reindexing
      com.liferay.portal.kernel.search.SearchException: java.lang.StringIndexOutOfBoundsException: String index out of range: 26104
      at com.liferay.portlet.journal.util.Indexer.reIndex(Indexer.java:195)
      at com.liferay.portal.search.lucene.LuceneIndexer.doReIndex(LuceneIndexer.java:155)
      at com.liferay.portal.search.lucene.LuceneIndexer.reIndex(LuceneIndexer.java:75)
      at com.liferay.portal.search.lucene.LuceneIndexer.reIndex(LuceneIndexer.java:68)
      at com.liferay.portlet.admin.action.EditServerAction.reIndex(EditServerAction.java:203)
      at com.liferay.portlet.admin.action.EditServerAction.processAction(EditServerAction.java:123)
      at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:180)
      at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
      at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:98)
      at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:57)
      at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:632)
      at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:664)
      at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:359)
      at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:604)
      at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:428)
      at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:195)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:157)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:608)
      at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:846)
      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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
      at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:143)
      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 com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:142)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:140)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:425)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:257)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter.processFilter(OpenSSOFilter.java:73)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:193)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:197)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.servlet.filters.threadlocalcache.ThreadLocalCacheFilter.processFilter(ThreadLocalCacheFilter.java:55)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
      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.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
      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:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      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:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 26104
      at java.lang.String.substring(String.java:1934)
      at com.liferay.portal.kernel.util.StringUtil.replace(StringUtil.java:699)
      at com.liferay.portlet.journal.util.Indexer.getArticleDocument(Indexer.java:98)
      at com.liferay.portlet.journal.util.Indexer.updateArticle(Indexer.java:143)
      at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.reIndex(JournalArticleLocalServiceImpl.java:1507)
      at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.reIndexArticles(JournalArticleLocalServiceImpl.java:2528)
      at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.reIndexArticles(JournalArticleLocalServiceImpl.java:2517)
      at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.reIndex(JournalArticleLocalServiceImpl.java:1525)
      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:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      at com.liferay.portal.mirage.aop.JournalArticleLocalServiceAdvice.doInvoke(JournalArticleLocalServiceAdvice.java:133)
      at com.liferay.portal.mirage.aop.BaseMirageAdvice.invoke(BaseMirageAdvice.java:47)
      at sun.reflect.GeneratedMethodAccessor625.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
      at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy326.reIndex(Unknown Source)
      at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.reIndex(JournalArticleLocalServiceUtil.java:654)
      at com.liferay.portlet.journal.util.Indexer.reIndex(Indexer.java:192)
      ... 112 more

      The exception itself is not subject of this issues. In fact, it is covered in LPS-12958, caused by a JVM bug and fixed in JDK 6 update 22.

      The problem is that this exception thrown by the journal indexer caused that all my custom indexers where never called rendering the search index useless although we hardly even use the journal and a broken journal index would only be a very minor problem.

      LuceneIndexer.doReIndex is identical in version 5.2.3 and 6.0.5

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.saechang Michael Saechang
                Reporter:
                jens_goering Jens Göring (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                4 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  8 years, 35 weeks, 4 days ago