You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2021/11/16 20:03:38 UTC

[solr] branch main updated: SOLR-15785: Load custom endpoints from solr/lib (#408)

This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 111bd91  SOLR-15785: Load custom endpoints from solr/lib (#408)
111bd91 is described below

commit 111bd917e5d28f31bab059ca23068cb34a26b81b
Author: Nazerke Seidan <se...@gmail.com>
AuthorDate: Tue Nov 16 21:03:31 2021 +0100

    SOLR-15785: Load custom endpoints from solr/lib (#408)
    
    Previously only packages or WEB-INF/lib was possible.
    
    Co-authored-by: Nazerke Seidan <ns...@salesforce.com>
---
 solr/CHANGES.txt                                                    | 3 +++
 .../core/src/java/org/apache/solr/api/ContainerPluginsRegistry.java | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index eba215c..7d07cfb 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 8b798e1..7724d77 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;