mirror of https://github.com/apache/lucene.git
SOLR-863 -- Fixing NPE. DirectoryFactory should be created before calling SolrIndexWriter.getDirectory.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@727779 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82279f712f
commit
328cacec62
|
@ -357,6 +357,9 @@ public final class SolrCore implements SolrInfoMBean {
|
||||||
boolean indexExists = dirFile.canRead();
|
boolean indexExists = dirFile.canRead();
|
||||||
boolean firstTime = dirs.add(dirFile.getCanonicalPath());
|
boolean firstTime = dirs.add(dirFile.getCanonicalPath());
|
||||||
boolean removeLocks = solrConfig.getBool("mainIndex/unlockOnStartup", false);
|
boolean removeLocks = solrConfig.getBool("mainIndex/unlockOnStartup", false);
|
||||||
|
|
||||||
|
initDirectoryFactory();
|
||||||
|
|
||||||
if (indexExists && firstTime && removeLocks) {
|
if (indexExists && firstTime && removeLocks) {
|
||||||
// to remove locks, the directory must already exist... so we create it
|
// to remove locks, the directory must already exist... so we create it
|
||||||
// if it didn't exist already...
|
// if it didn't exist already...
|
||||||
|
@ -379,8 +382,6 @@ public final class SolrCore implements SolrInfoMBean {
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
initDirectoryFactory();
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue