Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-7984: wrong and misleading error message 'no default request handler is registered'

Noble Paul21bd68a44370
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 35ac2d871e9..c2616dcfb3c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -190,6 +190,8 @@ Bug Fixes
* SOLR-8004: RuleBasedAuthorization plugin does not work for the collection-admin-edit permission (noble)
+* SOLR-7984: wrong and misleading error message 'no default request handler is registered' (noble, hossman)
+
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/core/RequestHandlers.java b/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
index 8e093f0b553..7895dc14a89 100644
--- a/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
+++ b/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
@@ -130,12 +130,11 @@ public final class RequestHandlers {
handlers.init(Collections.emptyMap(),core, modifiedInfos);
handlers.alias(handlers.getDefault(), "");
log.info("Registered paths: {}" , StrUtils.join(new ArrayList<>(handlers.keySet()) , ',' ));
- if(!handlers.alias( "/select","")){
- if(!handlers.alias( "standard","")){
+ if (handlers.get("") == null && !handlers.alias("/select", "")) {
+ if (handlers.get("") == null && !handlers.alias("standard", "")) {
log.warn("no default request handler is registered (either '/select' or 'standard')");
}
}
-
}
private PluginInfo applyInitParams(SolrConfig config, PluginInfo info) {