diff --git a/harvester/heritrix3/heritrix3-controller/src/main/java/dk/netarkivet/harvester/heritrix3/controller/HeritrixController.java b/harvester/heritrix3/heritrix3-controller/src/main/java/dk/netarkivet/harvester/heritrix3/controller/HeritrixController.java index af64634715..a29a79caf7 100644 --- a/harvester/heritrix3/heritrix3-controller/src/main/java/dk/netarkivet/harvester/heritrix3/controller/HeritrixController.java +++ b/harvester/heritrix3/heritrix3-controller/src/main/java/dk/netarkivet/harvester/heritrix3/controller/HeritrixController.java @@ -156,11 +156,11 @@ public void requestCrawlStart() { log.debug("Result of buildJobConfiguration() operation: " + new String(jobResult.response, "UTF-8")); if (jobResult.status == ResultStatus.OK) { if (jobResult.job.statusDescription.equalsIgnoreCase("Unbuilt")) { - throw new HeritrixLaunchException("The job '" + jobName + "' could not be built. Last loglines is " + StringUtils.join(jobResult.job.jobLogTail, "\n")); + throw new HeritrixLaunchException("The job '" + jobName + "' could not be built. Last loglines are " + StringUtils.join(jobResult.job.jobLogTail, "\n")); } else if (jobResult.job.statusDescription.equalsIgnoreCase("Ready")) { log.info("Job {} built successfully", jobName); } else if (jobResult.job.statusDescription.startsWith("Finished")) { // Created but not launchable - log.warn("The job {} seems unlaunchable. Tearing down the job. Last loglines is ", jobName, + log.warn("The job {} seems unlaunchable. Tearing down the job. Last loglines are ", jobName, StringUtils.join(jobResult.job.jobLogTail, "\n")); jobResult = h3wrapper.teardownJob(jobName); log.debug("Result of teardown() operation: " + new String(jobResult.response, "UTF-8")); @@ -174,7 +174,7 @@ public void requestCrawlStart() { } jobResult = h3wrapper.waitForJobState(jobName, CrawlControllerState.NASCENT, 60, 1000); - if (jobResult.job.crawlControllerState.equals(CrawlControllerState.NASCENT)) { + if (jobResult.job.crawlControllerState.equalsIgnoreCase(CrawlControllerState.NASCENT.toString())) { log.info("The H3 job {} in now in state CrawlControllerState.NASCENT", jobName); } else { log.warn("The job state is now {}. Should have been CrawlControllerState.NASCENT", jobResult.job.crawlControllerState); @@ -183,7 +183,7 @@ public void requestCrawlStart() { log.debug("Result of launchJob() operation: " + new String(jobResult.response, "UTF-8")); jobResult = h3wrapper.waitForJobState(jobName, CrawlControllerState.PAUSED, 60, 1000); - if (jobResult.job.crawlControllerState.equals(CrawlControllerState.PAUSED)) { + if (jobResult.job.crawlControllerState.equalsIgnoreCase(CrawlControllerState.PAUSED.toString())) { log.info("The H3 job {} in now in state CrawlControllerState.PAUSED", jobName); } else { log.warn("The job state is now {}. Should have been CrawlControllerState.PAUSED", jobResult.job.crawlControllerState); @@ -283,7 +283,7 @@ public void cleanup(File crawlDir) { log.warn("Should be one job but there is {} jobs: {}", knownJobs.size(), knownJobsToString(engineResult)); } } else { - log.warn("Unresponsive Heritrix3 engine. Lets try continuing the cleanup anyway"); + log.warn("Unresponsive Heritrix3 engine. Let's try continuing the cleanup anyway"); } // Check that job jobName still exists in H3 engine @@ -327,7 +327,7 @@ public void cleanup(File crawlDir) { private String knownJobsToString(EngineResult engineResult) { - String result = null; + String result = ""; if (engineResult == null || engineResult.engine == null || engineResult.engine.jobs == null) { result = null; } else {