From 16eca8ca9f07d2827d8dde77bf905087e4e1b8ab Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 17 Jun 2019 13:34:30 -0400 Subject: [PATCH] Initialize Tika when the core module is loaded. --- .../org/sleuthkit/autopsy/core/Installer.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index a9a4131ea4..329fe3dfc9 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -46,6 +46,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.PlatformUtil; +import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; /** * Wrapper over Installers in packages in Core module. This is the main @@ -226,6 +227,21 @@ public class Installer extends ModuleInstall { packageInstallers.add(org.sleuthkit.autopsy.ingest.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.centralrepository.eventlisteners.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.healthmonitor.Installer.getDefault()); + + /** + * This is a temporary workaround for the following bug in Tika that + * results in a null pointer exception when used from the Image Gallery. + * The current hypothesis is that the Image Gallery is cancelling the + * thumbnail task that Tika initialization is happening on. Once the + * Tika issue has been fixed we should no longer need this workaround. + * + * https://issues.apache.org/jira/browse/TIKA-2896 + */ + try { + FileTypeDetector fileTypeDetector = new FileTypeDetector(); + } catch (FileTypeDetector.FileTypeDetectorInitException ex) { + logger.log(Level.SEVERE, "Failed to load file type detector.", ex); + } } /**