Skip to content

Apache Lucene open-source search software

SOLR-6188: Only load resources in SOLRHOME/lib once.

Shawn Heisey99ede423de57
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;
}