Skip to content

Apache Lucene open-source search software

SOLR-7126: honor the enable.runtime.lib flag

Noble Paula0ff7fdef269
diff --git a/solr/core/src/java/org/apache/solr/core/PluginRegistry.java b/solr/core/src/java/org/apache/solr/core/PluginRegistry.java
index 2e33c18b690..850d44e26ee 100644
--- a/solr/core/src/java/org/apache/solr/core/PluginRegistry.java
+++ b/solr/core/src/java/org/apache/solr/core/PluginRegistry.java
@@ -276,6 +276,13 @@ public class PluginRegistry<T> implements AutoCloseable {
this.pluginMeta = pluginMeta;
this.core = core;
this.resourceLoader = loader;
+ if (loader instanceof MemClassLoader) {
+ if (!"true".equals(System.getProperty("enable.runtime.lib"))) {
+ String s = "runtime library loading is not enabled, start Solr with -Denable.runtime.lib=true";
+ log.warn(s);
+ solrException = new SolrException(SolrException.ErrorCode.SERVER_ERROR, s);
+ }
+ }
}
@Override