Skip to content

Commit b55a388

Browse files
authored
Merge pull request #6753 from eugene7646/release-4.18.0
Potential NPE fix in SU Solr logic (7343)
2 parents 8418223 + edb24ce commit b55a388

File tree

1 file changed

+9
-2
lines changed
  • KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch

1 file changed

+9
-2
lines changed

KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,18 @@ private HttpSolrClient configureMultiUserConnection(Case theCase, Index index, S
671671
"Server.status.failed.msg=Local Solr server did not respond to status request. This may be because the server failed to start or is taking too long to initialize.",})
672672
synchronized void startLocalSolr(SOLR_VERSION version) throws KeywordSearchModuleException, SolrServerNoPortException, SolrServerException {
673673

674+
logger.log(Level.INFO, "Starting local Solr " + version + " server"); //NON-NLS
675+
if (version == SOLR_VERSION.SOLR8) {
676+
localSolrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false); //NON-NLS
677+
} else {
678+
// solr4
679+
localSolrFolder = InstalledFileLocator.getDefault().locate("solr4", Server.class.getPackage().getName(), false); //NON-NLS
680+
}
681+
674682
if (isLocalSolrRunning()) {
675683
if (localServerVersion.equals(version)) {
676684
// this version of local server is already running
685+
logger.log(Level.INFO, "Local Solr " + version + " server is already running"); //NON-NLS
677686
return;
678687
} else {
679688
// wrong version of local server is running, stop it
@@ -715,12 +724,10 @@ synchronized void startLocalSolr(SOLR_VERSION version) throws KeywordSearchModul
715724
try {
716725
if (version == SOLR_VERSION.SOLR8) {
717726
logger.log(Level.INFO, "Starting Solr 8 server"); //NON-NLS
718-
localSolrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false); //NON-NLS
719727
curSolrProcess = runLocalSolr8ControlCommand(new ArrayList<>(Arrays.asList("start", "-p", //NON-NLS
720728
Integer.toString(localSolrServerPort)))); //NON-NLS
721729
} else {
722730
// solr4
723-
localSolrFolder = InstalledFileLocator.getDefault().locate("solr4", Server.class.getPackage().getName(), false); //NON-NLS
724731
logger.log(Level.INFO, "Starting Solr 4 server"); //NON-NLS
725732
curSolrProcess = runLocalSolr4ControlCommand(new ArrayList<>(
726733
Arrays.asList("-Dbootstrap_confdir=../solr/configsets/AutopsyConfig/conf", //NON-NLS

0 commit comments

Comments
 (0)