From 99ede423de57b96f06cb8fabadda2c4916b2576f Mon Sep 17 00:00:00 2001 From: Shawn Heisey Date: Thu, 8 Oct 2015 22:40:53 +0000 Subject: [PATCH] SOLR-6188: Only load resources in SOLRHOME/lib once. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1707630 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 5 +++++ .../org/apache/solr/core/SolrResourceLoader.java | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 0d21c670b2a..75b10a74a8d 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -71,6 +71,11 @@ New Features * SOLR-8038: Add the StatsStream to the Streaming API and wire it into the SQLHandler (Joel Bernstein) +* SOLR-6188: Skip the automatic loading of resources in the "lib" subdirectory + by SolrResourceLoader, but only if we are loading resources from the solr + home directory. Fixes the inability to use ICU analysis components with a + "solr." prefix on the classname. (Shawn Heisey) + Optimizations ---------------------- * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java index c7b004a697e..9b3ee01ce8e 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java +++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java @@ -140,8 +140,16 @@ public class SolrResourceLoader implements ResourceLoader,Closeable } this.classLoader = createClassLoader(null, parent); - addToClassLoader("./lib/", null, true); - reloadLuceneSPI(); + /* + * Skip the lib subdirectory when we are loading from the solr home. + * Otherwise load it, so core lib directories still get loaded. + * The default sharedLib will pick this up later, and if the user has + * changed sharedLib, then we don't want to load that location anyway. + */ + if (! this.instanceDir.equals(SolrResourceLoader.locateSolrHome())) { + addToClassLoader("./lib/", null, true); + reloadLuceneSPI(); + } this.coreProperties = coreProperties; }