Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
4.6.1, 4.7
-
None
-
None
-
None
Description
getSolrConfigFromZk method at ZkContainer is as follows:
public SolrConfig getSolrConfigFromZk(String zkConfigName, String solrConfigFileName, SolrResourceLoader resourceLoader) { SolrConfig cfg = null; try { byte[] config = zkController.getConfigFileData(zkConfigName, solrConfigFileName); InputSource is = new InputSource(new ByteArrayInputStream(config)); is.setSystemId(SystemIdResolver .createSystemIdFromResourceName(solrConfigFileName)); cfg = solrConfigFileName == null ? new SolrConfig(resourceLoader, SolrConfig.DEFAULT_CONF_FILE, is) : new SolrConfig(resourceLoader, solrConfigFileName, is); } catch (Exception e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "getSolrConfigFromZK failed for " + zkConfigName + " " + solrConfigFileName, e); } return cfg; }
createSystemIdFromResourceName method has that line:
name = name.replace(File.separatorChar, '/');
and there is a check condition for solrConfigFileName getSolrConfigFromZk so createSystemIdFromResourceName may throw a null pointer exception. On the other hand if solrConfigFileName is null this line will not work as expected:
byte[] config = zkController.getConfigFileData(zkConfigName, solrConfigFileName);