diff --git a/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java index 8bfc126cef..76ffa70926 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/sevenzip/SevenZipIngestModule.java @@ -90,6 +90,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F private final byte[] fileHeaderBuffer = new byte[readHeaderSize]; private static final int ZIP_SIGNATURE_BE = 0x504B0304; private IngestJobContext context; + private long jobId; SevenZipIngestModule() { } @@ -97,6 +98,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F @Override public void startUp(IngestJobContext context) throws IngestModuleException { this.context = context; + jobId = context.getJobId(); final Case currentCase = Case.getCurrentCase(); @@ -121,20 +123,23 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F } } - try { - SevenZip.initSevenZipFromPlatformJAR(); - String platform = SevenZip.getUsedPlatform(); - logger.log(Level.INFO, "7-Zip-JBinding library was initialized on supported platform: {0}", platform); - } catch (SevenZipNativeInitializationException e) { - logger.log(Level.SEVERE, "Error initializing 7-Zip-JBinding library", e); - String msg = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.init.errInitModule.msg", - ArchiveFileExtractorModuleFactory.getModuleName()); - String details = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.init.errCantInitLib", - e.getMessage()); - services.postMessage(IngestMessage.createErrorMessage(ArchiveFileExtractorModuleFactory.getModuleName(), msg, details)); - throw new RuntimeException(e); + // if first instance of this module for this job then check 7zip init + if (IngestModuleAdapter.moduleRefCountIncrement(jobId) == 1) { + try { + SevenZip.initSevenZipFromPlatformJAR(); + String platform = SevenZip.getUsedPlatform(); + logger.log(Level.INFO, "7-Zip-JBinding library was initialized on supported platform: {0}", platform); + } catch (SevenZipNativeInitializationException e) { + logger.log(Level.SEVERE, "Error initializing 7-Zip-JBinding library", e); + String msg = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.init.errInitModule.msg", + ArchiveFileExtractorModuleFactory.getModuleName()); + String details = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.init.errCantInitLib", + e.getMessage()); + services.postMessage(IngestMessage.createErrorMessage(ArchiveFileExtractorModuleFactory.getModuleName(), msg, details)); + throw new RuntimeException(e); + } } - + archiveDepthCountTree = new ArchiveDepthCountTree(); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index ad903141ed..fb7b5cc3d5 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -128,9 +128,9 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme tikaFormatDetector = new Tika(); ingester = Server.getIngester(); + // increment the module reference count + // if first instance of this module for this job then check the server and existence of keywords if (IngestModuleAdapter.moduleRefCountIncrement(jobId) == 1) { - // if first module for this job then check the server and existence of keywords - final Server server = KeywordSearch.getServer(); try { if (!server.isRunning()) {