Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-15785: Load custom endpoints from solr/lib (#408)

Nazerke Seidan111bd917e5d2
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index eba215cb479..7d07cfb14b6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -170,6 +170,9 @@ when told to. The admin UI now tells it to. (Nazerke Seidan, David Smiley)
* SOLR-15790: SearchHandler now includes the `rid` value in the Logging MDC for the duration of the request, allowing custom logging
configurations to include it. (hossman)
+* SOLR-15785: Custom node request handlers/endpoints that weren't in packages can now be located in JARs in solr-home/lib,
+ not just WEB-INF/lib. (Nazerke Seidan, David Smiley)
+
Build
---------------------
diff --git a/solr/core/src/java/org/apache/solr/api/ContainerPluginsRegistry.java b/solr/core/src/java/org/apache/solr/api/ContainerPluginsRegistry.java
index 8b798e174da..7724d777666 100644
--- a/solr/core/src/java/org/apache/solr/api/ContainerPluginsRegistry.java
+++ b/solr/core/src/java/org/apache/solr/api/ContainerPluginsRegistry.java
@@ -344,9 +344,9 @@ public class ContainerPluginsRegistry implements ClusterPropertiesListener, MapW
}
} else {
try {
- klas = Class.forName(klassInfo.className);
- } catch (ClassNotFoundException e) {
- errs.add("Error loading class " + e.toString());
+ klas = coreContainer.getResourceLoader().findClass(klassInfo.className, Object.class);
+ } catch (Exception e) {
+ errs.add(e.toString());
return;
}
pkgVersion = null;