You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Florian Holeczek (JIRA)" <ji...@apache.org> on 2011/09/11 01:13:08 UTC

[jira] [Closed] (JSPWIKI-411) LuceneSearchProvider dies with corrupted files

     [ https://issues.apache.org/jira/browse/JSPWIKI-411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florian Holeczek closed JSPWIKI-411.
------------------------------------


> LuceneSearchProvider dies with corrupted files
> ----------------------------------------------
>
>                 Key: JSPWIKI-411
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-411
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Plugins
>    Affects Versions: 2.6.4
>         Environment: LuceneSearchProvider and ReadableAttachmentProvider (
>            Reporter: Kurt Stein
>            Assignee: Harry Metske
>             Fix For: 2.8.1
>
>
> If someone uploads a corrupted files(i.e. 0-Byte or non readable pdf-content) the lucene index crashes. Even with a new full reindex the lucene indexer chrashes every time he touches the corrupted file.
> I have analyzed the code. In the method doFullLuceneReindex() there is a Try- Catch block that catches the exception coming form the call  getAttachmentContent(att.getName(), WikiProvider.LATEST_VERSION ).
> But thus the indexer stops at this points and no other attachment will be added to the lucene index.
>                     for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )
>                     {
>                         Attachment att = (Attachment) iterator.next();
>                         String text = getAttachmentContent( att.getName(),
>                                                             WikiProvider.LATEST_VERSION );
>                         luceneIndexPage( att, text, writer );
>                     }
> I would fixed it like this
>                     for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )
>                     {
>                         Attachment att = (Attachment) iterator.next();
>                         try
>                         {
>                             String text = getAttachmentContent( att.getName(), WikiProvider.LATEST_VERSION );
>                             luceneIndexPage( att, text, writer );
>                         }
>                         catch (Throwable t)
>                         {
>                             //goto next Attachment iterator
>                             log.error("Error on indexing file " + att.getFileName(), t);
>                         }
>                     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira