Apache Solr open-source search software
SOLR-4839: Upgrade to Jetty 9
Shalin Shekhar Mangara41b9954d197
diff --git a/dev-tools/maven/lucene/replicator/pom.xml.template b/dev-tools/maven/lucene/replicator/pom.xml.templateindex 1f287b7ecf6..60d00852cfd 100644--- a/dev-tools/maven/lucene/replicator/pom.xml.template+++ b/dev-tools/maven/lucene/replicator/pom.xml.template@@ -68,11 +68,6 @@<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId>- <configuration>- <systemPropertyVariables>- <tests.jettyConnector>${tests.jettyConnector}</tests.jettyConnector>- </systemPropertyVariables>- </configuration></plugin></plugins></build>diff --git a/dev-tools/maven/solr/pom.xml.template b/dev-tools/maven/solr/pom.xml.templateindex c2fd1a12cef..518748d3ba8 100644--- a/dev-tools/maven/solr/pom.xml.template+++ b/dev-tools/maven/solr/pom.xml.template@@ -103,7 +103,6 @@<artifactId>maven-surefire-plugin</artifactId><configuration><systemPropertyVariables>- <tests.jettyConnector>${tests.jettyConnector}</tests.jettyConnector><tests.disableHdfs>${tests.disableHdfs}</tests.disableHdfs></systemPropertyVariables></configuration>diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex c7975d30a90..478ead50ab9 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -1036,7 +1036,6 @@<propertyref prefix="tests.badapples" /><propertyref prefix="tests.bwcdir" /><propertyref prefix="tests.timeoutSuite" />- <propertyref prefix="tests.jettyConnector" /><propertyref prefix="tests.disableHdfs" /><propertyref prefix="tests.filter" /><propertyref prefix="tests.leavetmpdir" />diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.propertiesindex f94ece483df..d32b9e846f7 100644--- a/lucene/ivy-versions.properties+++ b/lucene/ivy-versions.properties@@ -70,7 +70,7 @@ com.sun.jersey.version = 1.9/jakarta-regexp/jakarta-regexp = 1.4/javax.activation/activation = 1.1.1/javax.inject/javax.inject= 1-/javax.servlet/javax.servlet-api = 3.0.1+/javax.servlet/javax.servlet-api = 3.1.0/javax.servlet/servlet-api = 2.4/jdom/jdom = 1.0/joda-time/joda-time = 2.2@@ -178,7 +178,7 @@ org.codehaus.jackson.version = 1.9.13/org.easymock/easymock = 3.0/org.eclipse.jetty.orbit/javax.servlet = 3.0.0.v201112011016-org.eclipse.jetty.version = 8.1.10.v20130312+org.eclipse.jetty.version = 9.2.6.v20141205/org.eclipse.jetty/jetty-continuation = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-deploy = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-http = ${org.eclipse.jetty.version}@@ -187,6 +187,7 @@ org.eclipse.jetty.version = 8.1.10.v20130312/org.eclipse.jetty/jetty-security = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-server = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-servlet = ${org.eclipse.jetty.version}+/org.eclipse.jetty/jetty-servlets = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-start = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-util = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-webapp = ${org.eclipse.jetty.version}@@ -219,7 +220,7 @@ org.ow2.asm.version = 4.1/org.ow2.asm/asm = ${org.ow2.asm.version}/org.ow2.asm/asm-commons = ${org.ow2.asm.version}-org.restlet.jee.version = 2.1.1+org.restlet.jee.version = 2.3.0/org.restlet.jee/org.restlet = ${org.restlet.jee.version}/org.restlet.jee/org.restlet.ext.servlet = ${org.restlet.jee.version}diff --git a/lucene/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1deleted file mode 100644index 40d32c2e00f..00000000000--- a/lucene/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-c0e26574ddcac7a86486f19a8b3782657acfd961diff --git a/lucene/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..6566b24a6cb--- /dev/null+++ b/lucene/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+74ca2679e461e7e9b5fdffcf9685575a7d5f5c8ediff --git a/lucene/licenses/jetty-http-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-http-8.1.10.v20130312.jar.sha1deleted file mode 100644index 7cc91649c4e..00000000000--- a/lucene/licenses/jetty-http-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d9eb53007e04d6338f12f3ded60fad1f7bfcb40ediff --git a/lucene/licenses/jetty-http-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-http-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..eee8f10c15f--- /dev/null+++ b/lucene/licenses/jetty-http-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+5484771191612c1f5a57466865b7014ff56886cediff --git a/lucene/licenses/jetty-io-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-io-8.1.10.v20130312.jar.sha1deleted file mode 100644index 2ba8e66bf24..00000000000--- a/lucene/licenses/jetty-io-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-e829c768f2b9de5d9fae3bc0aba3996bd0344f56diff --git a/lucene/licenses/jetty-io-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-io-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..bc69203d6eb--- /dev/null+++ b/lucene/licenses/jetty-io-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+11b84cc7078745fca844bd2fb95c2b4f818eafc2diff --git a/lucene/licenses/jetty-server-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-server-8.1.10.v20130312.jar.sha1deleted file mode 100644index 2674565b8f6..00000000000--- a/lucene/licenses/jetty-server-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-13ca9587bc1645f8fac89454b15252a2ad5bdcf5diff --git a/lucene/licenses/jetty-server-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-server-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..bba3d066e56--- /dev/null+++ b/lucene/licenses/jetty-server-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+5960eb385ded42360045447185a0510365f811dcdiff --git a/lucene/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1deleted file mode 100644index ac4faaac6ca..00000000000--- a/lucene/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-98f8029fe7236e9c66381c04f292b5319f47ca84diff --git a/lucene/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..c29ef43e874--- /dev/null+++ b/lucene/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+026aa018ef20780e8a900ae7fc95f59884d3095bdiff --git a/lucene/licenses/jetty-util-8.1.10.v20130312.jar.sha1 b/lucene/licenses/jetty-util-8.1.10.v20130312.jar.sha1deleted file mode 100644index cff356ddd4e..00000000000--- a/lucene/licenses/jetty-util-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d198a8ad8ea20b4fb74c781175c48500ec2b8b7adiff --git a/lucene/licenses/jetty-util-9.2.6.v20141205.jar.sha1 b/lucene/licenses/jetty-util-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..6da0dcc040c--- /dev/null+++ b/lucene/licenses/jetty-util-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+fdfa0b969d99a2dfb2a46c0ff00251d7e6c7b2bbdiff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java b/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.javaindex aca90b7d347..410d551da44 100644--- a/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java@@ -18,18 +18,20 @@ package org.apache.lucene.replicator;*/import java.util.Random;+import java.util.concurrent.TimeUnit;import org.apache.http.conn.HttpClientConnectionManager;import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;import org.apache.lucene.util.LuceneTestCase;import org.eclipse.jetty.server.Connector;import org.eclipse.jetty.server.Handler;+import org.eclipse.jetty.server.HttpConfiguration;+import org.eclipse.jetty.server.HttpConnectionFactory;+import org.eclipse.jetty.server.SecureRequestCustomizer;import org.eclipse.jetty.server.Server;-import org.eclipse.jetty.server.bio.SocketConnector;-import org.eclipse.jetty.server.nio.SelectChannelConnector;+import org.eclipse.jetty.server.ServerConnector;+import org.eclipse.jetty.server.SslConnectionFactory;import org.eclipse.jetty.server.session.HashSessionIdManager;-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;-import org.eclipse.jetty.server.ssl.SslSocketConnector;import org.eclipse.jetty.util.ssl.SslContextFactory;import org.eclipse.jetty.util.thread.QueuedThreadPool;import org.junit.AfterClass;@@ -51,12 +53,6 @@ public abstract class ReplicatorTestCase extends LuceneTestCase {* {@link #serverPort(Server)}.*/public static synchronized Server newHttpServer(Handler handler) throws Exception {- Server server = new Server(0);-- server.setHandler(handler);-- final String connectorName = System.getProperty("tests.jettyConnector", "SelectChannel");-// if this property is true, then jetty will be configured to use SSL// leveraging the same system properties as java to specify// the keystore/truststore if they are set@@ -78,7 +74,7 @@ public abstract class ReplicatorTestCase extends LuceneTestCase {(System.getProperty("javax.net.ssl.keyStorePassword"));}if (null != System.getProperty("javax.net.ssl.trustStore")) {- sslcontext.setTrustStore+ sslcontext.setKeyStorePath(System.getProperty("javax.net.ssl.trustStore"));}if (null != System.getProperty("javax.net.ssl.trustStorePassword")) {@@ -88,34 +84,36 @@ public abstract class ReplicatorTestCase extends LuceneTestCase {sslcontext.setNeedClientAuth(Boolean.getBoolean("tests.jettySsl.clientAuth"));}- final Connector connector;- final QueuedThreadPool threadPool;- if ("SelectChannel".equals(connectorName)) {- final SelectChannelConnector c = useSsl ? new SslSelectChannelConnector(sslcontext) : new SelectChannelConnector();- c.setReuseAddress(true);- c.setLowResourcesMaxIdleTime(1500);- connector = c;- threadPool = (QueuedThreadPool) c.getThreadPool();- } else if ("Socket".equals(connectorName)) {- final SocketConnector c = useSsl ? new SslSocketConnector(sslcontext) : new SocketConnector();- c.setReuseAddress(true);+ final QueuedThreadPool threadPool = new QueuedThreadPool();+ threadPool.setDaemon(true);+ threadPool.setMaxThreads(10000);+ threadPool.setIdleTimeout(5000);+ threadPool.setStopTimeout(30000);++ Server server = new Server(threadPool);+ server.setStopAtShutdown(true);+ server.manage(threadPool);+++ final ServerConnector connector;+ if (useSsl) {+ HttpConfiguration configuration = new HttpConfiguration();+ configuration.setSecureScheme("https");+ configuration.addCustomizer(new SecureRequestCustomizer());+ ServerConnector c = new ServerConnector(server, new SslConnectionFactory(sslcontext, "http/1.1"),+ new HttpConnectionFactory(configuration));connector = c;- threadPool = (QueuedThreadPool) c.getThreadPool();} else {- throw new IllegalArgumentException("Illegal value for system property 'tests.jettyConnector': " + connectorName);+ ServerConnector c = new ServerConnector(server, new HttpConnectionFactory());+ connector = c;}connector.setPort(0);connector.setHost("127.0.0.1");- if (threadPool != null) {- threadPool.setDaemon(true);- threadPool.setMaxThreads(10000);- threadPool.setMaxIdleTimeMs(5000);- threadPool.setMaxStopTimeMs(30000);- }-+server.setConnectors(new Connector[] {connector});server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));+ server.setHandler(handler);server.start();@@ -124,12 +122,12 @@ public abstract class ReplicatorTestCase extends LuceneTestCase {/** Returns a {@link Server}'s port. */public static int serverPort(Server server) {- return server.getConnectors()[0].getLocalPort();+ return ((ServerConnector)server.getConnectors()[0]).getLocalPort();}/** Returns a {@link Server}'s host. */public static String serverHost(Server server) {- return server.getConnectors()[0].getHost();+ return ((ServerConnector)server.getConnectors()[0]).getHost();}/**diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex dc6aa364556..5a836721ab1 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -62,6 +62,7 @@ Carrot2 3.9.0Velocity 1.7 and Velocity Tools 2.0Apache UIMA 2.3.1Apache ZooKeeper 3.4.6+Jetty 9.2.6.v20141205Upgrading from Solr 4.x----------------------@@ -626,6 +627,9 @@ Other Changes* SOLR-6905: Test pseudo-field retrieval in distributed search.(Ramkumar Aiyengar via shalin)+* SOLR-4839: Upgrade Jetty to 9.2.6.v20141205 and restlet-jee to 2.3.0+ (Bill Bell, Timothy Potter, Uwe Schindler, shalin)+================== 4.10.3 ==================Bug Fixesdiff --git a/solr/bin/solr b/solr/bin/solrindex 1af990ae18d..1af1354f2cc 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -1138,6 +1138,7 @@ function launch_solr() {SOLR_START_OPTS="-server -Xss256k $SOLR_JAVA_MEM $GC_TUNE $GC_LOG_OPTS $REMOTE_JMX_OPTS \$CLOUD_MODE_OPTS \+-Djetty.home=$SOLR_SERVER_DIR-DSTOP.PORT=$stop_port -DSTOP.KEY=$STOP_KEY \$SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \-Dsolr.solr.home=$SOLR_HOME \diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.javaindex 72adbcd3f38..a34691a2c60 100644--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java@@ -19,17 +19,19 @@ package org.apache.solr.client.solrj.embedded;import org.apache.solr.servlet.SolrDispatchFilter;import org.eclipse.jetty.server.Connector;+import org.eclipse.jetty.server.HttpConfiguration;+import org.eclipse.jetty.server.HttpConnectionFactory;+import org.eclipse.jetty.server.LowResourceMonitor;+import org.eclipse.jetty.server.SecureRequestCustomizer;import org.eclipse.jetty.server.Server;-import org.eclipse.jetty.server.bio.SocketConnector;-import org.eclipse.jetty.server.handler.GzipHandler;-import org.eclipse.jetty.server.nio.SelectChannelConnector;+import org.eclipse.jetty.server.ServerConnector;+import org.eclipse.jetty.server.SslConnectionFactory;import org.eclipse.jetty.server.session.HashSessionIdManager;-import org.eclipse.jetty.server.ssl.SslConnector;-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;-import org.eclipse.jetty.server.ssl.SslSocketConnector;import org.eclipse.jetty.servlet.FilterHolder;import org.eclipse.jetty.servlet.ServletContextHandler;import org.eclipse.jetty.servlet.ServletHolder;+import org.eclipse.jetty.servlets.GzipFilter;+import org.eclipse.jetty.servlets.gzip.GzipHandler;import org.eclipse.jetty.util.component.LifeCycle;import org.eclipse.jetty.util.log.Logger;import org.eclipse.jetty.util.ssl.SslContextFactory;@@ -202,18 +204,11 @@ public class JettySolrRunner {private void init(String solrHome, String context, int port, boolean stopAtShutdown) {this.context = context;- server = new Server(port);this.solrHome = solrHome;this.stopAtShutdown = stopAtShutdown;- server.setStopAtShutdown(stopAtShutdown);- if (!stopAtShutdown) {- server.setGracefulShutdown(0);- }System.setProperty("solr.solr.home", solrHome);if (System.getProperty("jetty.testMode") != null) {- final String connectorName = System.getProperty("tests.jettyConnector", "SelectChannel");-// if this property is true, then jetty will be configured to use SSL// leveraging the same system properties as java to specify// the keystore/truststore if they are set unless specific config@@ -227,52 +222,56 @@ public class JettySolrRunner {final SslContextFactory sslcontext = new SslContextFactory(false);sslInit(useSsl, sslcontext);- final Connector connector;- if ("SelectChannel".equals(connectorName)) {- final SelectChannelConnector c = useSsl- ? new SslSelectChannelConnector(sslcontext)- : new SelectChannelConnector();- c.setReuseAddress(true);- c.setLowResourcesMaxIdleTime(1500);- c.setSoLingerTime(0);- connector = c;- } else if ("Socket".equals(connectorName)) {- final SocketConnector c = useSsl- ? new SslSocketConnector(sslcontext)- : new SocketConnector();- c.setReuseAddress(true);- c.setSoLingerTime(0);- connector = c;+ QueuedThreadPool qtp = new QueuedThreadPool();+ qtp.setMaxThreads(10000);+ qtp.setIdleTimeout((int) TimeUnit.SECONDS.toMillis(5));+ qtp.setStopTimeout((int) TimeUnit.MINUTES.toMillis(1));++ server = new Server(qtp);+ server.setStopAtShutdown(stopAtShutdown);+ server.manage(qtp);++ ServerConnector connector;+ if (useSsl) {+ HttpConfiguration configuration = new HttpConfiguration();+ configuration.setSecureScheme("https");+ configuration.addCustomizer(new SecureRequestCustomizer());+ connector = new ServerConnector(server, new SslConnectionFactory(sslcontext, "http/1.1"),+ new HttpConnectionFactory(configuration));} else {- throw new IllegalArgumentException("Illegal value for system property 'tests.jettyConnector': " + connectorName);+ connector = new ServerConnector(server, new HttpConnectionFactory());}+ connector.setReuseAddress(true);+ connector.setSoLingerTime(0);connector.setPort(port);connector.setHost("127.0.0.1");- // Connectors by default inherit server's thread pool.- QueuedThreadPool qtp = new QueuedThreadPool();- qtp.setMaxThreads(10000);- qtp.setMaxIdleTimeMs((int) TimeUnit.MILLISECONDS.toMillis(200));- qtp.setMaxStopTimeMs((int) TimeUnit.MINUTES.toMillis(1));- server.setThreadPool(qtp);+ // Enable Low Resources Management+ LowResourceMonitor lowResources = new LowResourceMonitor(server);+ lowResources.setLowResourcesIdleTimeout(1500);+ lowResources.setMaxConnections(10000);+ server.addBean(lowResources);server.setConnectors(new Connector[] {connector});server.setSessionIdManager(new HashSessionIdManager(new Random()));} else {- if (server.getThreadPool() == null) {- // Connectors by default inherit server's thread pool.- QueuedThreadPool qtp = new QueuedThreadPool();- qtp.setMaxThreads(10000);- qtp.setMaxIdleTimeMs((int) TimeUnit.SECONDS.toMillis(5));- qtp.setMaxStopTimeMs((int) TimeUnit.SECONDS.toMillis(1));- server.setThreadPool(qtp);- }+ ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory());+ connector.setPort(port);++ QueuedThreadPool qtp = new QueuedThreadPool();+ qtp.setMaxThreads(10000);+ qtp.setIdleTimeout((int) TimeUnit.SECONDS.toMillis(5));+ qtp.setStopTimeout((int) TimeUnit.SECONDS.toMillis(1));++ server = new Server(qtp);+ server.setStopAtShutdown(stopAtShutdown);+ server.manage(qtp);}// Initialize the servlets- final ServletContextHandler root = new ServletContextHandler(server,context,ServletContextHandler.SESSIONS);- root.setHandler(new GzipHandler());+ final ServletContextHandler root = new ServletContextHandler(server, context, ServletContextHandler.SESSIONS);+ root.addFilter(GzipFilter.class, "*", EnumSet.of(DispatcherType.REQUEST));server.addLifeCycleListener(new LifeCycle.Listener() {@Override@@ -309,11 +308,11 @@ public class JettySolrRunner {EnumSet.of(DispatcherType.REQUEST)));}}- dispatchFilter = root.addFilter(SolrDispatchFilter.class, "*", EnumSet.of(DispatcherType.REQUEST) );for (ServletHolder servletHolder : extraServlets.keySet()) {String pathSpec = extraServlets.get(servletHolder);root.addServlet(servletHolder, pathSpec);}+ dispatchFilter = root.addFilter(SolrDispatchFilter.class, "*", EnumSet.of(DispatcherType.REQUEST) );if (solrConfigFilename != null) System.clearProperty("solrconfig");if (schemaFilename != null) System.clearProperty("schema");System.clearProperty("solr.solr.home");@@ -339,7 +338,7 @@ public class JettySolrRunner {sslcontext.setKeyStorePassword(sslConfig.getKeyStorePassword());}if (null != sslConfig.getTrustStore()) {- sslcontext.setTrustStore(System+ sslcontext.setTrustStorePath(System.getProperty(sslConfig.getTrustStore()));}if (null != sslConfig.getTrustStorePassword()) {@@ -359,7 +358,7 @@ public class JettySolrRunner {(System.getProperty("javax.net.ssl.keyStorePassword"));}if (null != System.getProperty("javax.net.ssl.trustStore")) {- sslcontext.setTrustStore+ sslcontext.setTrustStorePath(System.getProperty("javax.net.ssl.trustStore"));}if (null != System.getProperty("javax.net.ssl.trustStorePassword")) {@@ -464,7 +463,7 @@ public class JettySolrRunner {if (0 == conns.length) {throw new RuntimeException("Jetty Server has no Connectors");}- return (proxyPort != -1) ? proxyPort : conns[0].getLocalPort();+ return (proxyPort != -1) ? proxyPort : ((ServerConnector) conns[0]).getLocalPort();}/**@@ -489,7 +488,7 @@ public class JettySolrRunner {}/**- * Returns a base URL consisting of the protocal, host, and port for a+ * Returns a base URL consisting of the protocol, host, and port for a* Connector in use by the Jetty Server contained in this runner.*/public URL getBaseUrl() {@@ -499,12 +498,12 @@ public class JettySolrRunner {if (0 == conns.length) {throw new IllegalStateException("Jetty Server has no Connectors");}- Connector c = conns[0];+ ServerConnector c = (ServerConnector) conns[0];if (c.getLocalPort() < 0) {throw new IllegalStateException("Jetty Connector is not open: " +c.getLocalPort());}- protocol = (c instanceof SslConnector) ? "https" : "http";+ protocol = c.getDefaultProtocol().equals("SSL-http/1.1") ? "https" : "http";return new URL(protocol, c.getHost(), c.getLocalPort(), context);} catch (MalformedURLException e) {@@ -614,6 +613,11 @@ class NoLog implements Logger {}+ @Override+ public void debug(String s, long l) {++ }+@Overridepublic String getName() {return toString();diff --git a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.javaindex dcd0904cd2b..08e3baa3a9b 100644--- a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java+++ b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java@@ -22,7 +22,9 @@ import static org.easymock.EasyMock.createMock;import static org.easymock.EasyMock.expect;import static org.easymock.EasyMock.replay;+import java.io.BufferedInputStream;import java.io.ByteArrayInputStream;+import java.io.IOException;import java.net.HttpURLConnection;import java.net.SocketTimeoutException;import java.net.URL;@@ -34,6 +36,7 @@ import java.util.List;import java.util.Map;import java.util.Vector;+import javax.servlet.ReadListener;import javax.servlet.ServletInputStream;import javax.servlet.http.HttpServletRequest;@@ -225,10 +228,7 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {expect(request.getContentType()).andReturn( contentType ).anyTimes();expect(request.getQueryString()).andReturn(getParams).anyTimes();expect(request.getContentLength()).andReturn(postBytes.length).anyTimes();- expect(request.getInputStream()).andReturn(new ServletInputStream() {- private final ByteArrayInputStream in = new ByteArrayInputStream(postBytes);- @Override public int read() { return in.read(); }- });+ expect(request.getInputStream()).andReturn(new ByteServletInputStream(postBytes));replay(request);MultipartRequestParser multipart = new MultipartRequestParser( 2048 );@@ -243,6 +243,39 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {assertArrayEquals( "contentType: "+contentType, new String[]{"foo","bar"}, p.getParams("dup") );}}++ static class ByteServletInputStream extends ServletInputStream {+ final BufferedInputStream in;+ final int len;+ int readCount = 0;++ public ByteServletInputStream(byte[] data) {+ this.len = data.length;+ this.in = new BufferedInputStream(new ByteArrayInputStream(data));+ }++ @Override+ public boolean isFinished() {+ return readCount == len;+ }++ @Override+ public boolean isReady() {+ return true;+ }++ @Override+ public void setReadListener(ReadListener readListener) {+ throw new IllegalStateException("Not supported");+ }++ @Override+ public int read() throws IOException {+ int read = in.read();+ readCount += read;+ return read;+ }+ }@Testpublic void testStandardParseParamsAndFillStreamsISO88591() throws Exception@@ -257,10 +290,7 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {expect(request.getContentType()).andReturn( contentType ).anyTimes();expect(request.getQueryString()).andReturn(getParams).anyTimes();expect(request.getContentLength()).andReturn(postBytes.length).anyTimes();- expect(request.getInputStream()).andReturn(new ServletInputStream() {- private final ByteArrayInputStream in = new ByteArrayInputStream(postBytes);- @Override public int read() { return in.read(); }- });+ expect(request.getInputStream()).andReturn(new ByteServletInputStream(postBytes));replay(request);MultipartRequestParser multipart = new MultipartRequestParser( 2048 );@@ -292,10 +322,7 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {// we dont pass a content-length to let the security mechanism limit it:expect(request.getContentLength()).andReturn(-1).anyTimes();expect(request.getQueryString()).andReturn(null).anyTimes();- expect(request.getInputStream()).andReturn(new ServletInputStream() {- private final ByteArrayInputStream in = new ByteArrayInputStream(large.toString().getBytes(StandardCharsets.US_ASCII));- @Override public int read() { return in.read(); }- });+ expect(request.getInputStream()).andReturn(new ByteServletInputStream(large.toString().getBytes(StandardCharsets.US_ASCII)));replay(request);FormDataRequestParser formdata = new FormDataRequestParser( limitKBytes );@@ -319,6 +346,21 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {// we emulate Jetty that returns empty stream when parameters were parsed before:expect(request.getInputStream()).andReturn(new ServletInputStream() {@Override public int read() { return -1; }++ @Override+ public boolean isFinished() {+ return true;+ }++ @Override+ public boolean isReady() {+ return true;+ }++ @Override+ public void setReadListener(ReadListener readListener) {++ }});replay(request);diff --git a/solr/licenses/javax.servlet-api-3.0.1.jar.sha1 b/solr/licenses/javax.servlet-api-3.0.1.jar.sha1deleted file mode 100644index a660a301f9c..00000000000--- a/solr/licenses/javax.servlet-api-3.0.1.jar.sha1+++ /dev/null@@ -1 +0,0 @@-6bf0ebb7efd993e222fc1112377b5e92a13b38dddiff --git a/solr/licenses/javax.servlet-api-3.1.0.jar.sha1 b/solr/licenses/javax.servlet-api-3.1.0.jar.sha1new file mode 100644index 00000000000..a269ca04f74--- /dev/null+++ b/solr/licenses/javax.servlet-api-3.1.0.jar.sha1@@ -0,0 +1 @@+3cd63d075497751784b2fa84be59432f4905bf7cdiff --git a/solr/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1deleted file mode 100644index 40d32c2e00f..00000000000--- a/solr/licenses/jetty-continuation-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-c0e26574ddcac7a86486f19a8b3782657acfd961diff --git a/solr/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..6566b24a6cb--- /dev/null+++ b/solr/licenses/jetty-continuation-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+74ca2679e461e7e9b5fdffcf9685575a7d5f5c8ediff --git a/solr/licenses/jetty-deploy-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-deploy-8.1.10.v20130312.jar.sha1deleted file mode 100644index 7262965587b..00000000000--- a/solr/licenses/jetty-deploy-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-875b96ef84e3b83a40b3aac9e473434d6414a389diff --git a/solr/licenses/jetty-deploy-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-deploy-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..c606e908486--- /dev/null+++ b/solr/licenses/jetty-deploy-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+7ad677c1442dc965b5815f4452848b8eecbc5082diff --git a/solr/licenses/jetty-http-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-http-8.1.10.v20130312.jar.sha1deleted file mode 100644index 7cc91649c4e..00000000000--- a/solr/licenses/jetty-http-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d9eb53007e04d6338f12f3ded60fad1f7bfcb40ediff --git a/solr/licenses/jetty-http-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-http-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..eee8f10c15f--- /dev/null+++ b/solr/licenses/jetty-http-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+5484771191612c1f5a57466865b7014ff56886cediff --git a/solr/licenses/jetty-io-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-io-8.1.10.v20130312.jar.sha1deleted file mode 100644index 2ba8e66bf24..00000000000--- a/solr/licenses/jetty-io-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-e829c768f2b9de5d9fae3bc0aba3996bd0344f56diff --git a/solr/licenses/jetty-io-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-io-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..bc69203d6eb--- /dev/null+++ b/solr/licenses/jetty-io-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+11b84cc7078745fca844bd2fb95c2b4f818eafc2diff --git a/solr/licenses/jetty-jmx-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-jmx-8.1.10.v20130312.jar.sha1deleted file mode 100644index e400550c907..00000000000--- a/solr/licenses/jetty-jmx-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-6e48870e2af2caf2a77751eae3a79bfcf6b90a78diff --git a/solr/licenses/jetty-jmx-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-jmx-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..d62a76e69ea--- /dev/null+++ b/solr/licenses/jetty-jmx-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+53ebf8bd8d151c3c7883e3b23eee9f67ecd716e9diff --git a/solr/licenses/jetty-security-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-security-8.1.10.v20130312.jar.sha1deleted file mode 100644index 2de8273372f..00000000000--- a/solr/licenses/jetty-security-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-a386e7f0a8b9157b99a2f29a6deac61e007a2b9bdiff --git a/solr/licenses/jetty-security-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-security-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..495af06df1e--- /dev/null+++ b/solr/licenses/jetty-security-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+513537c2a4f7d2a44120f4ff5fdc7fc2c8bc9357diff --git a/solr/licenses/jetty-server-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-server-8.1.10.v20130312.jar.sha1deleted file mode 100644index 2674565b8f6..00000000000--- a/solr/licenses/jetty-server-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-13ca9587bc1645f8fac89454b15252a2ad5bdcf5diff --git a/solr/licenses/jetty-server-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-server-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..bba3d066e56--- /dev/null+++ b/solr/licenses/jetty-server-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+5960eb385ded42360045447185a0510365f811dcdiff --git a/solr/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1deleted file mode 100644index ac4faaac6ca..00000000000--- a/solr/licenses/jetty-servlet-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-98f8029fe7236e9c66381c04f292b5319f47ca84diff --git a/solr/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..c29ef43e874--- /dev/null+++ b/solr/licenses/jetty-servlet-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+026aa018ef20780e8a900ae7fc95f59884d3095bdiff --git a/solr/licenses/jetty-servlets-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-servlets-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..8396ef25972--- /dev/null+++ b/solr/licenses/jetty-servlets-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+0e36f5f1d19c48ad1ae6e65172ee472d0ba8b571diff --git a/solr/licenses/jetty-util-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-util-8.1.10.v20130312.jar.sha1deleted file mode 100644index cff356ddd4e..00000000000--- a/solr/licenses/jetty-util-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d198a8ad8ea20b4fb74c781175c48500ec2b8b7adiff --git a/solr/licenses/jetty-util-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-util-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..6da0dcc040c--- /dev/null+++ b/solr/licenses/jetty-util-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+fdfa0b969d99a2dfb2a46c0ff00251d7e6c7b2bbdiff --git a/solr/licenses/jetty-webapp-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-webapp-8.1.10.v20130312.jar.sha1deleted file mode 100644index fded150fab4..00000000000--- a/solr/licenses/jetty-webapp-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-a3353244b93e895f1ca8f607077f247063470233diff --git a/solr/licenses/jetty-webapp-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-webapp-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..20c144e2c9c--- /dev/null+++ b/solr/licenses/jetty-webapp-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+68da2c29c6bedac8d502839fea66b91e05077a68diff --git a/solr/licenses/jetty-xml-8.1.10.v20130312.jar.sha1 b/solr/licenses/jetty-xml-8.1.10.v20130312.jar.sha1deleted file mode 100644index db8de90f5d3..00000000000--- a/solr/licenses/jetty-xml-8.1.10.v20130312.jar.sha1+++ /dev/null@@ -1 +0,0 @@-96eb17dd4265732b0cb9cd15e36f83633832dd65diff --git a/solr/licenses/jetty-xml-9.2.6.v20141205.jar.sha1 b/solr/licenses/jetty-xml-9.2.6.v20141205.jar.sha1new file mode 100644index 00000000000..dfd78fbbc99--- /dev/null+++ b/solr/licenses/jetty-xml-9.2.6.v20141205.jar.sha1@@ -0,0 +1 @@+2f51a87d2c962257304391aa29e1c0030774c4acdiff --git a/solr/licenses/org.restlet-2.1.1.jar.sha1 b/solr/licenses/org.restlet-2.1.1.jar.sha1deleted file mode 100644index 4b0aa1ff96f..00000000000--- a/solr/licenses/org.restlet-2.1.1.jar.sha1+++ /dev/null@@ -1 +0,0 @@-e12c23b962c925f2681729afa1e40066a350ad27diff --git a/solr/licenses/org.restlet-2.3.0.jar.sha1 b/solr/licenses/org.restlet-2.3.0.jar.sha1new file mode 100644index 00000000000..77e949d323e--- /dev/null+++ b/solr/licenses/org.restlet-2.3.0.jar.sha1@@ -0,0 +1 @@+4c5d184e23fa729726668a90dc7338d80c4e7e6fdiff --git a/solr/licenses/org.restlet.ext.servlet-2.1.1.jar.sha1 b/solr/licenses/org.restlet.ext.servlet-2.1.1.jar.sha1deleted file mode 100644index a51aa82c0ec..00000000000--- a/solr/licenses/org.restlet.ext.servlet-2.1.1.jar.sha1+++ /dev/null@@ -1 +0,0 @@-72baf27dc19d98f43c362ded582db408433373eediff --git a/solr/licenses/org.restlet.ext.servlet-2.3.0.jar.sha1 b/solr/licenses/org.restlet.ext.servlet-2.3.0.jar.sha1new file mode 100644index 00000000000..32c31ad33cc--- /dev/null+++ b/solr/licenses/org.restlet.ext.servlet-2.3.0.jar.sha1@@ -0,0 +1 @@+9303e20d0397c0304342943560c3a1693fd7ce7ddiff --git a/solr/licenses/start.jar.sha1 b/solr/licenses/start.jar.sha1index a375ce17183..5ef2c26fc1b 100644--- a/solr/licenses/start.jar.sha1+++ b/solr/licenses/start.jar.sha1@@ -1 +1 @@-8e1a37a8daae3f222d957012f826047497466a56+6380e0fe5a738cced80ef705dbac3320a8f25edfdiff --git a/solr/server/contexts/solr-jetty-context.xml b/solr/server/contexts/solr-jetty-context.xmlindex 50978a365ff..306cfa0b8f2 100644--- a/solr/server/contexts/solr-jetty-context.xml+++ b/solr/server/contexts/solr-jetty-context.xml@@ -1,8 +1,8 @@<?xml version="1.0"?>-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"><Configure class="org.eclipse.jetty.webapp.WebAppContext">- <Set name="contextPath"><SystemProperty name="hostContext" default="/solr"/></Set>- <Set name="war"><SystemProperty name="jetty.home"/>/webapps/solr.war</Set>- <Set name="defaultsDescriptor"><SystemProperty name="jetty.home"/>/etc/webdefault.xml</Set>- <Set name="tempDirectory"><Property name="jetty.home" default="."/>/solr-webapp</Set>+ <Set name="contextPath"><Property name="hostContext" default="/solr"/></Set>+ <Set name="war"><Property name="jetty.base"/>/webapps/solr.war</Set>+ <Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set>+ <Set name="tempDirectory"><Property name="jetty.base" default="."/>/solr-webapp</Set></Configure>diff --git a/solr/server/etc/jetty-http.xml b/solr/server/etc/jetty-http.xmlnew file mode 100644index 00000000000..58c542d1ea4--- /dev/null+++ b/solr/server/etc/jetty-http.xml@@ -0,0 +1,75 @@+<?xml version="1.0"?>+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">++<!-- ============================================================= -->+<!-- Configure the Jetty Server instance with an ID "Server" -->+<!-- by adding a HTTP connector. -->+<!-- This configuration must be used in conjunction with jetty.xml -->+<!-- ============================================================= -->+<Configure id="Server" class="org.eclipse.jetty.server.Server">++ <!-- =========================================================== -->+ <!-- Server Thread Pool -->+ <!-- =========================================================== -->+ <Get name="ThreadPool">+ <!-- Default queued blocking threadpool -->+ <Set name="minThreads"><Property name="jetty.threads.min" /></Set>+ <Set name="maxThreads"><Property name="jetty.threads.max" /></Set>+ <Set name="detailedDump">false</Set>+ <Set name="idleTimeout"><Property name="jetty.threads.idle.timeout" /></Set>+ </Get>++ <!-- =========================================================== -->+ <!-- Add a HTTP Connector. -->+ <!-- Configure an o.e.j.server.ServerConnector with a single -->+ <!-- HttpConnectionFactory instance using the common httpConfig -->+ <!-- instance defined in jetty.xml -->+ <!-- -->+ <!-- Consult the javadoc of o.e.j.server.ServerConnector and -->+ <!-- o.e.j.server.HttpConnectionFactory for all configuration -->+ <!-- that may be set here. -->+ <!-- =========================================================== -->+ <Call name="addConnector">+ <Arg>+ <New class="org.eclipse.jetty.server.ServerConnector">+ <Arg name="server"><Ref refid="Server" /></Arg>+ <Arg name="acceptors" type="int"><Property name="jetty.http.acceptors" default="-1"/></Arg>+ <Arg name="selectors" type="int"><Property name="jetty.http.selectors" default="-1"/></Arg>+ <Arg name="factories">+ <Array type="org.eclipse.jetty.server.ConnectionFactory">+ <Item>+ <New class="org.eclipse.jetty.server.HttpConnectionFactory">+ <Arg name="config">+ <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">+ <Set name="sendServerVersion">false</Set>+ <Set name="sendDateHeader">false</Set>+ </New>+ </Arg>+ </New>+ </Item>+ </Array>+ </Arg>+ <Set name="port"><Property name="jetty.port" /></Set>+ <Set name="host"><Property name="jetty.host" /></Set>+ </New>+ </Arg>+ </Call>++</Configure>\ No newline at end of filediff --git a/solr/server/etc/jetty-https.xml b/solr/server/etc/jetty-https.xmlnew file mode 100644index 00000000000..fd060201ee7--- /dev/null+++ b/solr/server/etc/jetty-https.xml@@ -0,0 +1,45 @@+<?xml version="1.0"?>+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">++<!-- ============================================================= -->+<!-- Configure a HTTPS connector. -->+<!-- This configuration must be used in conjunction with jetty.xml -->+<!-- and jetty-ssl.xml. -->+<!-- ============================================================= -->+<Configure id="sslConnector" class="org.eclipse.jetty.server.ServerConnector">++ <Call name="addIfAbsentConnectionFactory">+ <Arg>+ <New class="org.eclipse.jetty.server.SslConnectionFactory">+ <Arg name="next">http/1.1</Arg>+ <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>+ </New>+ </Arg>+ </Call>++ <Call name="addConnectionFactory">+ <Arg>+ <New class="org.eclipse.jetty.server.HttpConnectionFactory">+ <Arg name="config"><Ref refid="sslHttpConfig" /></Arg>+ </New>+ </Arg>+ </Call>++</Configure>\ No newline at end of filediff --git a/solr/server/etc/jetty-ssl.xml b/solr/server/etc/jetty-ssl.xmlnew file mode 100644index 00000000000..0a1c25905da--- /dev/null+++ b/solr/server/etc/jetty-ssl.xml@@ -0,0 +1,95 @@+<?xml version="1.0"?>+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">++<!-- ============================================================= -->+<!-- Base SSL configuration -->+<!-- This configuration needs to be used together with 1 or more -->+<!-- of jetty-https.xml, jetty-spdy.xml and/or jetty-http2.xml -->+<!-- ============================================================= -->+<Configure id="Server" class="org.eclipse.jetty.server.Server">++ <!-- =========================================================== -->+ <!-- Add a SSL Connector with no protocol factories -->+ <!-- =========================================================== -->+ <Call name="addConnector">+ <Arg>+ <New id="sslConnector" class="org.eclipse.jetty.server.ServerConnector">+ <Arg name="server"><Ref refid="Server" /></Arg>+ <Arg name="acceptors" type="int"><Property name="ssl.acceptors" default="-1"/></Arg>+ <Arg name="selectors" type="int"><Property name="ssl.selectors" default="-1"/></Arg>+ <Arg name="factories">+ <Array type="org.eclipse.jetty.server.ConnectionFactory">+ <!-- uncomment to support proxy protocol+ <Item>+ <New class="org.eclipse.jetty.server.ProxyConnectionFactory"/>+ </Item>-->+ </Array>+ </Arg>++ <Set name="host"><Property name="jetty.host" /></Set>+ <Set name="port"><Property name="ssl.port" default="443" /></Set>+ <Set name="idleTimeout"><Property name="ssl.timeout" default="30000"/></Set>+ <Set name="soLingerTime"><Property name="ssl.soLingerTime" default="-1"/></Set>+ <Set name="acceptorPriorityDelta"><Property name="ssl.acceptorPriorityDelta" default="0"/></Set>+ <Set name="selectorPriorityDelta"><Property name="ssl.selectorPriorityDelta" default="0"/></Set>+ <Set name="acceptQueueSize"><Property name="ssl.acceptQueueSize" default="0"/></Set>+ </New>+ </Arg>+ </Call>++ <!-- ============================================================= -->+ <!-- Create a TLS (SSL) Context Factory for later reuse -->+ <!-- ============================================================= -->+ <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">+ <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.keystore" default="etc/keystore"/></Set>+ <Set name="KeyStorePassword"><Property name="jetty.keystore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>+ <Set name="KeyManagerPassword"><Property name="jetty.keymanager.password" default="OBF:1u2u1wml1z7s1z7a1wnl1u2g"/></Set>+ <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.truststore" default="etc/keystore"/></Set>+ <Set name="TrustStorePassword"><Property name="jetty.truststore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>+ <Set name="EndpointIdentificationAlgorithm"></Set>+ <Set name="NeedClientAuth"><Property name="jetty.ssl.needClientAuth" default="false"/></Set>+ <Set name="WantClientAuth"><Property name="jetty.ssl.wantClientAuth" default="false"/></Set>+ <Set name="ExcludeCipherSuites">+ <Array type="String">+ <Item>SSL_RSA_WITH_DES_CBC_SHA</Item>+ <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item>+ <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item>+ <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item>+ <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>+ <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>+ <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item>+ </Array>+ </Set>+ </New>++ <!-- =========================================================== -->+ <!-- Create a TLS specific HttpConfiguration based on the -->+ <!-- common HttpConfiguration defined in jetty.xml -->+ <!-- Add a SecureRequestCustomizer to extract certificate and -->+ <!-- session information -->+ <!-- =========================================================== -->+ <New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">+ <Arg><Ref refid="httpConfig"/></Arg>+ <Call name="addCustomizer">+ <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>+ </Call>+ </New>++</Configure>\ No newline at end of filediff --git a/solr/server/etc/jetty.xml b/solr/server/etc/jetty.xmlindex 7596a6cde7c..f5976ed6537 100644--- a/solr/server/etc/jetty.xml+++ b/solr/server/etc/jetty.xml@@ -1,5 +1,5 @@<?xml version="1.0"?>-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"><!-- =============================================================== --><!-- Configure the Jetty Server -->@@ -12,54 +12,6 @@<Configure id="Server" class="org.eclipse.jetty.server.Server">- <!-- =========================================================== -->- <!-- Server Thread Pool -->- <!-- =========================================================== -->- <Set name="ThreadPool">- <!-- Default queued blocking threadpool -->- <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">- <Set name="minThreads">10</Set>- <Set name="maxThreads">10000</Set>- <Set name="detailedDump">false</Set>- </New>- </Set>-- <!-- =========================================================== -->- <!-- Set connectors -->- <!-- =========================================================== -->-- <!--- <Call name="addConnector">- <Arg>- <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">- <Set name="host"><SystemProperty name="jetty.host" /></Set>- <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>- <Set name="maxIdleTime">50000</Set>- <Set name="Acceptors">2</Set>- <Set name="statsOn">false</Set>- <Set name="confidentialPort">8443</Set>- <Set name="lowResourcesConnections">5000</Set>- <Set name="lowResourcesMaxIdleTime">5000</Set>- </New>- </Arg>- </Call>- -->-- <!-- This connector is currently being used for Solr because it- showed better performance than nio.SelectChannelConnector- for typical Solr requests. -->- <Call name="addConnector">- <Arg>- <New class="org.eclipse.jetty.server.bio.SocketConnector">- <Set name="host"><SystemProperty name="jetty.host" /></Set>- <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>- <Set name="maxIdleTime">50000</Set>- <Set name="lowResourceMaxIdleTime">1500</Set>- <Set name="statsOn">false</Set>- </New>- </Arg>- </Call>-<!-- if the connector below is uncommented, then jetty will also accept SSLconnections on port 8984, using a self signed certificate and canoptionally require the client to authenticate with a certificate.@@ -121,7 +73,7 @@<!-- =========================================================== --><!-- Configure Request Log --><!-- =========================================================== -->- <!--+ <!--<Ref id="Handlers"><Call name="addHandler"><Arg>@@ -149,26 +101,28 @@<!-- extra options --><!-- =========================================================== --><Set name="stopAtShutdown">true</Set>- <Set name="sendServerVersion">false</Set>- <Set name="sendDateHeader">false</Set>- <Set name="gracefulShutdown">1000</Set><Set name="dumpAfterStart">false</Set><Set name="dumpBeforeStop">false</Set>---<Call name="addBean"><Arg><New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager"><Set name="contexts">- <Ref id="Contexts" />+ <Ref refid="Contexts" /></Set><Call name="setContextAttribute"><Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg><Arg>.*/servlet-api-[^/]*\.jar$</Arg></Call>-++ <Call name="addAppProvider">+ <Arg>+ <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">+ <Set name="monitoredDirName"><Property name="jetty.home" default="."/>/contexts</Set>+ <Set name="scanInterval">0</Set>+ </New>+ </Arg>+ </Call><!-- Add a customize step to the deployment lifecycle --><!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class@@ -190,15 +144,4 @@</Arg></Call>- <Ref id="DeploymentManager">- <Call name="addAppProvider">- <Arg>- <New class="org.eclipse.jetty.deploy.providers.ContextProvider">- <Set name="monitoredDirName"><SystemProperty name="jetty.home" default="."/>/contexts</Set>- <Set name="scanInterval">0</Set>- </New>- </Arg>- </Call>- </Ref>-</Configure>diff --git a/solr/server/ivy.xml b/solr/server/ivy.xmlindex 7453958d0df..832b0b246ca 100644--- a/solr/server/ivy.xml+++ b/solr/server/ivy.xml@@ -40,10 +40,13 @@<dependency org="org.eclipse.jetty" name="jetty-security" rev="${/org.eclipse.jetty/jetty-security}" conf="jetty"/><dependency org="org.eclipse.jetty" name="jetty-server" rev="${/org.eclipse.jetty/jetty-server}" conf="jetty"/><dependency org="org.eclipse.jetty" name="jetty-servlet" rev="${/org.eclipse.jetty/jetty-servlet}" conf="jetty"/>+ <dependency org="org.eclipse.jetty" name="jetty-servlets" rev="${/org.eclipse.jetty/jetty-servlets}" conf="jetty"/><dependency org="org.eclipse.jetty" name="jetty-util" rev="${/org.eclipse.jetty/jetty-util}" conf="jetty"/><dependency org="org.eclipse.jetty" name="jetty-webapp" rev="${/org.eclipse.jetty/jetty-webapp}" conf="jetty"/><dependency org="org.eclipse.jetty" name="jetty-xml" rev="${/org.eclipse.jetty/jetty-xml}" conf="jetty"/>+ <dependency org="javax.servlet" name="javax.servlet-api" rev="${/javax.servlet/javax.servlet-api}" conf="jetty"/>+<dependency org="org.eclipse.jetty" name="jetty-start" rev="${/org.eclipse.jetty/jetty-start}" conf="start"/><dependency org="org.eclipse.jetty.orbit" name="javax.servlet" rev="${/org.eclipse.jetty.orbit/javax.servlet}" conf="servlet">diff --git a/solr/server/modules/http.mod b/solr/server/modules/http.modnew file mode 100644index 00000000000..9a3e3abc663--- /dev/null+++ b/solr/server/modules/http.mod@@ -0,0 +1,26 @@+#+# Jetty HTTP Connector+#++[depend]+server++[xml]+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++etc/jetty-http.xml\ No newline at end of filediff --git a/solr/server/modules/https.mod b/solr/server/modules/https.modnew file mode 100644index 00000000000..32fe852e8f3--- /dev/null+++ b/solr/server/modules/https.mod@@ -0,0 +1,36 @@+#+# Jetty HTTPS Connector+#++[depend]+ssl++[xml]+etc/jetty-https.xml++[ini-template]+## HTTPS Configuration+# HTTP port to listen on+https.port=8443+# HTTPS idle timeout in milliseconds+https.timeout=30000+# HTTPS Socket.soLingerTime in seconds. (-1 to disable)+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++https.soLingerTime=-1+diff --git a/solr/server/modules/server.mod b/solr/server/modules/server.modnew file mode 100644index 00000000000..b418f9f4ab6--- /dev/null+++ b/solr/server/modules/server.mod@@ -0,0 +1,33 @@+#+# Base Server Module+#++[optional]+jvm+ext+resources++[lib]+lib/*.jar+lib/ext/*.jar+resources/++[xml]+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++etc/jetty.xml\ No newline at end of filediff --git a/solr/server/modules/ssl.mod b/solr/server/modules/ssl.modnew file mode 100644index 00000000000..cb420e297d6--- /dev/null+++ b/solr/server/modules/ssl.mod@@ -0,0 +1,57 @@+#+# SSL Keystore module+#++[depend]+server++[xml]+etc/jetty-ssl.xml++[files]+http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore|etc/keystore++[ini-template]+### SSL Keystore Configuration+# define the port to use for secure redirection+jetty.secure.port=8443++## Setup a demonstration keystore and truststore+jetty.keystore=etc/keystore+jetty.truststore=etc/keystore++## Set the demonstration passwords.+## Note that OBF passwords are not secure, just protected from casual observation+## See http://www.eclipse.org/jetty/documentation/current/configuring-security-secure-passwords.html+jetty.keystore.password=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4+jetty.keymanager.password=OBF:1u2u1wml1z7s1z7a1wnl1u2g+jetty.truststore.password=OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4++### Set the client auth behavior+## Set to true if client certificate authentication is required+# jetty.ssl.needClientAuth=true+## Set to true if client certificate authentication is desired+# jetty.ssl.wantClientAuth=true++## Parameters to control the number and priority of acceptors and selectors+# ssl.selectors=1+# ssl.acceptors=1+# ssl.selectorPriorityDelta=0+<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+ -->++ssl.acceptorPriorityDelta=0diff --git a/solr/server/resources/jetty-logging.properties b/solr/server/resources/jetty-logging.propertiesnew file mode 100644index 00000000000..8a2b5e3fbb4--- /dev/null+++ b/solr/server/resources/jetty-logging.properties@@ -0,0 +1,18 @@+#+# Licensed to the Apache Software Foundation (ASF) under one or more+# contributor license agreements. See the NOTICE file distributed with+# this work for additional information regarding copyright ownership.+# The ASF licenses this file to You under the Apache License, Version 2.0+# (the "License"); you may not use this file except in compliance with+# the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+#++org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog\ No newline at end of filediff --git a/solr/server/start.ini b/solr/server/start.ininew file mode 100644index 00000000000..88518bee47c--- /dev/null+++ b/solr/server/start.ini@@ -0,0 +1,11 @@+--module=http++jetty.port=8983++jetty.threads.min=10+jetty.threads.max=10000+jetty.threads.idle.timeout=50000++# jetty.http.acceptors=1+# jetty.http.selectors=1+diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/StartSolrJetty.java b/solr/solrj/src/test/org/apache/solr/client/solrj/StartSolrJetty.javaindex 2d8d565c8f6..3c0b92319c6 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/StartSolrJetty.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/StartSolrJetty.java@@ -18,8 +18,9 @@package org.apache.solr.client.solrj;import org.eclipse.jetty.server.Connector;+import org.eclipse.jetty.server.HttpConnectionFactory;import org.eclipse.jetty.server.Server;-import org.eclipse.jetty.server.bio.SocketConnector;+import org.eclipse.jetty.server.ServerConnector;import org.eclipse.jetty.webapp.WebAppContext;/**@@ -32,9 +33,9 @@ public class StartSolrJetty//System.setProperty("solr.solr.home", "../../../example/solr");Server server = new Server();- SocketConnector connector = new SocketConnector();+ ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory());// Set some timeout options to make debugging easier.- connector.setMaxIdleTime(1000 * 60 * 60);+ connector.setIdleTimeout(1000 * 60 * 60);connector.setSoLingerTime(-1);connector.setPort(8983);server.setConnectors(new Connector[] { connector });diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.javaindex 36750d14a69..4fb6230ba93 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java@@ -28,8 +28,9 @@ import org.apache.solr.SolrJettyTestBase;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.util.ExternalPaths;import org.eclipse.jetty.server.Connector;+import org.eclipse.jetty.server.HttpConnectionFactory;import org.eclipse.jetty.server.Server;-import org.eclipse.jetty.server.bio.SocketConnector;+import org.eclipse.jetty.server.ServerConnector;import org.eclipse.jetty.server.session.HashSessionIdManager;import org.eclipse.jetty.webapp.WebAppContext;import org.junit.Rule;@@ -71,8 +72,8 @@ public class JettyWebappTest extends SolrTestCaseJ4server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));new WebAppContext(server, path, context );- SocketConnector connector = new SocketConnector();- connector.setMaxIdleTime(1000 * 60 * 60);+ ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory());+ connector.setIdleTimeout(1000 * 60 * 60);connector.setSoLingerTime(-1);connector.setPort(0);server.setConnectors(new Connector[]{connector});