Apache Solr open-source search software
SOLR-17931: remove hostContext vestiges (#3815)
Eric Pugh4fdef7527c4c
diff --git a/changelog/unreleased/SOLR-17931_remove_hostContext.yml b/changelog/unreleased/SOLR-17931_remove_hostContext.ymlnew file mode 100644index 00000000000..6db36f648a8--- /dev/null+++ b/changelog/unreleased/SOLR-17931_remove_hostContext.yml@@ -0,0 +1,10 @@+# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc+title: Remove vestiges of hostContext. /solr everywhere.+type: removed # added, changed, fixed, deprecated, removed, dependency_update, security, other+authors:+ - name: Eric Pugh+links:+ - name: SOLR-17931+ url: https://issues.apache.org/jira/browse/SOLR-17931+issues:+ - 17931diff --git a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.javaindex 37bdceea9f1..53d301b7ce5 100644--- a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java+++ b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java@@ -505,13 +505,6 @@ public class SolrXmlConfig {}String hostName = required("solrcloud", "host", removeValue(nl, "host"));- // We no longer require or support the hostContext property, but legacy users may have it, so- // remove it from the list.- String hostContext = removeValue(nl, "hostContext");- if (hostContext != null) {- log.warn("solr.xml hostContext -- hostContext is deprecated and ignored.");- }-CloudConfig.CloudConfigBuilder builder = new CloudConfig.CloudConfigBuilder(hostName, hostPort);// set the defaultZkHost until/unless it's overridden in the "cloud section" (below)...builder.setZkHost(defaultZkHost);diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java b/solr/core/src/test/org/apache/solr/core/TestSolrXml.javaindex 6090361e420..daf30defc82 100644--- a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java+++ b/solr/core/src/test/org/apache/solr/core/TestSolrXml.java@@ -486,12 +486,6 @@ public class TestSolrXml extends SolrTestCaseJ4 {assertEquals("solrcloud section missing required entry 'host'", thrown.getMessage());}- public void testCloudConfigContinuesToWorkIfHostContextDefined() {- String solrXml =- "<solr><solrcloud><str name=\"host\">host</str><str name=\"hostContext\">legacyHostContent</str><int name=\"hostPort\">8983</int></solrcloud></solr>";- SolrXmlConfig.fromString(solrHome, solrXml);- }-public void testMultiBackupSectionError() {String solrXml = "<solr><backup></backup><backup></backup></solr>";SolrException thrown =diff --git a/solr/modules/cross-dc/src/test-files/mirroring-solr.xml b/solr/modules/cross-dc/src/test-files/mirroring-solr.xmlindex d5a8630b56f..b410bb698e1 100644--- a/solr/modules/cross-dc/src/test-files/mirroring-solr.xml+++ b/solr/modules/cross-dc/src/test-files/mirroring-solr.xml@@ -21,7 +21,6 @@<solrcloud><str name="host">${solr.host.advertise:}</str><int name="hostPort">${solr.port.advertise:0}</int>- <str name="hostContext">${hostContext:solr}</str><bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool><int name="zkClientTimeout">${zkClientTimeout:30000}</int><int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>diff --git a/solr/server/contexts/solr-jetty-context.xml b/solr/server/contexts/solr-jetty-context.xmlindex 979377932b0..6e801f77aaf 100644--- a/solr/server/contexts/solr-jetty-context.xml+++ b/solr/server/contexts/solr-jetty-context.xml@@ -1,7 +1,7 @@<?xml version="1.0"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_10_0.dtd"><Configure class="org.eclipse.jetty.ee10.webapp.WebAppContext">- <Set name="contextPath"><Property name="hostContext" default="/solr"/></Set>+ <Set name="contextPath">/solr</Set><Set name="war"><Property name="jetty.base"/>/solr-webapp/webapp</Set><Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set><Set name="extractWAR">false</Set>diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.javaindex da8d2379c82..2ae2398d98b 100644--- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java+++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java@@ -133,10 +133,6 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 {systemClearPropertySolrEnableUrlAllowList();}- private static String getHostContextSuitableForServletContext() {- return "/solr";- }-protected BaseDistributedSearchTestCase() {String solrHostContext = "/solr";this.deadServers =