commit
This commit is contained in:
38
solr/server/contexts/solr-jetty-context.xml
Normal file
38
solr/server/contexts/solr-jetty-context.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Set name="contextPath"><Property name="hostContext" default="/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>
|
||||
|
||||
<!--
|
||||
The rest of this file is necessary for us to deduplicate jetty server jars in our server build.
|
||||
Jetty disallows "server" classes that are loaded via the server classloader (live in server/lib/ or server/lib/ext/)
|
||||
from being used by the Webapp. Solr has a need for many of these classes, especially http and http2 for HTTP Client
|
||||
libraries.
|
||||
|
||||
By default, Solr would need to duplicate these jars between server/lib/ and WEB-INF/lib/.
|
||||
Therefore, if we want to deduplicate these Jetty jars, we need to remove the class packages that Solr uses from the
|
||||
Jetty "server" class matcher, using the "-" prefix in from of the sub-package name.
|
||||
|
||||
The default server class matcher can be found here:
|
||||
https://github.com/eclipse/jetty.project/blob/jetty-10.0.12/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java#L178
|
||||
|
||||
Setting parentLoaderPriority=true is also necessary in order to be able to use these classes from the server classloader.
|
||||
|
||||
Documentation for this can be found here: https://www.eclipse.org/jetty/documentation/jetty-10/old_docs/index.html#jetty-classloading
|
||||
-->
|
||||
<Set name="parentLoaderPriority">true</Set>
|
||||
<Call name="addServerClassMatcher">
|
||||
<Arg>
|
||||
<New id="removeServerClasses" class="org.eclipse.jetty.webapp.ClassMatcher">
|
||||
<Arg>
|
||||
<Array type="java.lang.String">
|
||||
<Item>-org.eclipse.jetty.</Item>
|
||||
</Array>
|
||||
</Arg>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Configure>
|
||||
Reference in New Issue
Block a user