incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florian Holeczek (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (JSPWIKI-411) LuceneSearchProvider dies with corrupted files
Date Sat, 10 Sep 2011 23:13:08 GMT

     [ 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

        

Mime
View raw message