diff --git a/src/java/org/apache/solr/core/PluginInfo.java b/src/java/org/apache/solr/core/PluginInfo.java index 68a5fd7551c..3fb1e4f9ae3 100644 --- a/src/java/org/apache/solr/core/PluginInfo.java +++ b/src/java/org/apache/solr/core/PluginInfo.java @@ -45,10 +45,10 @@ public class PluginInfo { } - public PluginInfo(Node node, String err, boolean requireName) { + public PluginInfo(Node node, String err, boolean requireName, boolean requireClass) { type = node.getNodeName(); name = DOMUtil.getAttr(node, "name", requireName ? err : null); - className = DOMUtil.getAttr(node, "class", err); + className = DOMUtil.getAttr(node, "class", requireClass ? err : null); isDefault = Boolean.parseBoolean(DOMUtil.getAttr(node, "default", null)); startup = DOMUtil.getAttr(node, "startup", null); initArgs = DOMUtil.childNodesToNamedList(node); diff --git a/src/java/org/apache/solr/core/SolrConfig.java b/src/java/org/apache/solr/core/SolrConfig.java index d0994d09aa9..be0364800e2 100644 --- a/src/java/org/apache/solr/core/SolrConfig.java +++ b/src/java/org/apache/solr/core/SolrConfig.java @@ -190,8 +190,8 @@ public class SolrConfig extends Config { protected void loadHighLightingPlugins() { highLghtingClass = get("highlighting/@class",null); - highlightingFragmenterInfo = loadPluginInfo("highlighting/fragmenter",true); - highlightingFormatterInfo = loadPluginInfo("highlighting/formatter",true); + highlightingFragmenterInfo = loadPluginInfo("highlighting/fragmenter",true,true); + highlightingFormatterInfo = loadPluginInfo("highlighting/formatter",true, true); } protected UpdateHandlerInfo loadUpdatehandlerInfo() { @@ -202,17 +202,17 @@ public class SolrConfig extends Config { } protected void loadPluginInfo() { - reqHandlerInfo = loadPluginInfo("requestHandler",true); - respWriterInfo = loadPluginInfo("queryResponseWriter",true); - valueSourceParserInfo = loadPluginInfo("valueSourceParser",true); - queryParserInfo = loadPluginInfo("queryParser",true); - searchComponentInfo = loadPluginInfo("searchComponent",true); - queryConverterInfo = loadPluginInfo("queryConverter",true); + reqHandlerInfo = loadPluginInfo("requestHandler",true, true); + respWriterInfo = loadPluginInfo("queryResponseWriter",true, true); + valueSourceParserInfo = loadPluginInfo("valueSourceParser",true, true); + queryParserInfo = loadPluginInfo("queryParser",true, true); + searchComponentInfo = loadPluginInfo("searchComponent",true, true); + queryConverterInfo = loadPluginInfo("queryConverter",true, true); directoryfactoryInfo = loadSinglePlugin("directoryFactory"); deletionPolicyInfo = loadSinglePlugin("mainIndex/deletionPolicy"); indexReaderFactoryInfo = loadSinglePlugin("indexReaderFactory"); - firstSearcherListenerInfo = loadPluginInfo("//listener[@event='firstSearcher']",false); - newSearcherListenerInfo = loadPluginInfo("//listener[@event='newSearcher']",false); + firstSearcherListenerInfo = loadPluginInfo("//listener[@event='firstSearcher']",false, true); + newSearcherListenerInfo = loadPluginInfo("//listener[@event='newSearcher']",false, true); } protected Map> loadUpdateProcessorInfo() { @@ -232,7 +232,7 @@ public class SolrConfig extends Config { } ArrayList result = new ArrayList(); for (int j=0; j l = loadPluginInfo(tag, false); + List l = loadPluginInfo(tag, false, true); return l.isEmpty() ? null : l.get(0); } - private List loadPluginInfo(String tag, boolean requireName) { + private List loadPluginInfo(String tag, boolean requireName, boolean requireClass) { ArrayList result = new ArrayList(); NodeList nodes = (NodeList) evaluate(tag, XPathConstants.NODESET); for (int i=0; i newSearcherListenerInfo; - private List queryConverterInfo; + protected List queryConverterInfo; + protected PluginInfo directoryfactoryInfo; protected Map> updateProcessorChainInfo ; protected UpdateHandlerInfo updateHandlerInfo ;