From bfa2dbf68c84daaf6ccab2ee2891231851859fee Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 29 Nov 2018 16:51:29 +0100
Subject: [PATCH 01/35] Issue #3162 - Use Jetty specific Servlet API jar.
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
to match the new Jetty Servlet API jar.
Signed-off-by: Simone Bordet
---
NOTICE.txt | 2 +-
aggregates/jetty-all/pom.xml | 4 ++--
aggregates/jetty-websocket-all/pom.xml | 4 ++--
apache-jsp/pom.xml | 6 +-----
apache-jsp/src/main/java/module-info.java | 2 +-
.../java/org/eclipse/jetty/jstl/JspConfig.java | 2 +-
examples/async-rest/async-rest-jar/pom.xml | 4 ++--
examples/async-rest/async-rest-webapp/pom.xml | 4 ++--
.../jetty/embedded/ServerWithAnnotations.java | 2 +-
jetty-annotations/src/main/java/module-info.java | 2 +-
jetty-ant/src/test/config/build.xml | 7 ++-----
jetty-client/pom.xml | 8 ++++----
.../test/resources/jetty-deploymgr-contexts.xml | 2 +-
.../screen-http-webapp-deploy-listconfig.adoc | 1 -
.../startup/screen-list-modules.adoc | 1 -
.../startup/startup-base-vs-home.adoc | 1 -
.../administration/startup/startup-classpath.adoc | 1 -
.../administration/startup/startup-jpms.adoc | 5 +----
.../administration/startup/startup-overview.adoc | 2 --
.../security/jetty-home-and-jetty-base.adoc | 2 --
.../development/maven/jetty-maven-plugin.adoc | 2 +-
jetty-fcgi/fcgi-server/pom.xml | 4 ++--
.../fcgi-server/src/main/java/module-info.java | 2 +-
jetty-home/pom.xml | 14 +++-----------
jetty-http/pom.xml | 6 +++---
jetty-http/src/main/java/module-info.java | 2 +-
jetty-http2/http2-client/pom.xml | 4 ++--
jetty-http2/http2-http-client-transport/pom.xml | 4 ++--
jetty-http2/http2-server/pom.xml | 4 ++--
jetty-jaas/src/main/java/module-info.java | 2 +-
jetty-jaspi/src/main/java/module-info.java | 2 +-
jetty-maven-plugin/src/it/it-parent-pom/pom.xml | 4 ++--
.../src/it/jetty-cdi-run-forked/pom.xml | 4 ++--
.../web/pom.xml | 4 ++--
.../jetty-simple-base/pom.xml | 6 ++----
.../jetty-simple-base/pom.xml | 5 ++---
.../jetty-run-mojo-it/jetty-simple-base/pom.xml | 5 ++---
.../jetty-simple-base/pom.xml | 5 ++---
.../jetty-simple-base/pom.xml | 5 ++---
.../jetty-start-mojo-it/jetty-simple-base/pom.xml | 5 ++---
.../src/it/run-mojo-gwt-it/beer-server/pom.xml | 4 ++--
.../jetty/maven/plugin/JettyWebAppContext.java | 2 +-
jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 4 ++--
jetty-osgi/jetty-osgi-httpservice/pom.xml | 4 ++--
jetty-osgi/test-jetty-osgi-context/pom.xml | 4 ----
jetty-osgi/test-jetty-osgi-server/pom.xml | 4 ----
jetty-osgi/test-jetty-osgi/pom.xml | 5 -----
jetty-plus/src/main/java/module-info.java | 2 +-
jetty-proxy/pom.xml | 4 ++--
jetty-proxy/src/main/java/module-info.java | 2 +-
jetty-quickstart/pom.xml | 15 ---------------
jetty-quickstart/src/main/java/module-info.java | 2 +-
jetty-rewrite/pom.xml | 4 ++--
jetty-rewrite/src/main/java/module-info.java | 2 +-
jetty-security/src/main/java/module-info.java | 2 +-
jetty-server/pom.xml | 4 ++--
jetty-server/src/main/config/modules/server.mod | 6 +-----
jetty-server/src/main/java/module-info.java | 2 +-
jetty-servlet/src/main/java/module-info.java | 2 +-
jetty-servlets/pom.xml | 6 +++---
jetty-servlets/src/main/java/module-info.java | 2 +-
jetty-util-ajax/pom.xml | 4 ++--
jetty-util/pom.xml | 6 +++---
jetty-util/src/main/java/module-info.java | 2 +-
jetty-webapp/src/main/java/module-info.java | 2 +-
.../src/main/java/module-info.java | 2 +-
jetty-websocket/jetty-websocket-server/pom.xml | 4 ++--
.../src/main/java/module-info.java | 2 +-
jetty-websocket/websocket-core/pom.xml | 1 +
.../websocket-core/src/main/java/module-info.java | 2 +-
.../src/main/java/module-info.java | 2 +-
pom.xml | 14 ++++----------
tests/jetty-jmh/pom.xml | 4 ++--
.../src/test/resources/RFC2616Base.xml | 2 +-
.../java/org/eclipse/jetty/test/jmx/JmxIT.java | 4 ++--
tests/test-jmx/jmx-webapp/pom.xml | 4 ++--
tests/test-webapps/test-http2-webapp/pom.xml | 6 +++---
tests/test-webapps/test-jetty-webapp/pom.xml | 4 ++--
tests/test-webapps/test-jndi-webapp/pom.xml | 10 +++++-----
tests/test-webapps/test-mock-resources/pom.xml | 4 ++--
tests/test-webapps/test-proxy-webapp/pom.xml | 6 +++---
.../test-container-initializer/pom.xml | 6 +++---
.../test-servlet-spec/test-spec-webapp/pom.xml | 6 +++---
.../test-servlet-spec/test-web-fragment/pom.xml | 11 ++---------
tests/test-webapps/test-webapp-rfc2616/pom.xml | 4 ++--
85 files changed, 134 insertions(+), 211 deletions(-)
diff --git a/NOTICE.txt b/NOTICE.txt
index 9ca92f1f7044..9e1b0952d899 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -105,7 +105,7 @@ The following artifacts are CDDL + GPLv2 with classpath exception.
https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html
-org.eclipse.jetty.toolchain:jetty-schemas
+org.eclipse.jetty.toolchain:jetty-servlet-api
------
Assorted
diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml
index 0dfad2ed81e6..d6d1cd7cdb5a 100644
--- a/aggregates/jetty-all/pom.xml
+++ b/aggregates/jetty-all/pom.xml
@@ -213,8 +213,8 @@
javax.websocket-api
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
javax.transaction
diff --git a/aggregates/jetty-websocket-all/pom.xml b/aggregates/jetty-websocket-all/pom.xml
index 90c71f63685c..197d244727ab 100644
--- a/aggregates/jetty-websocket-all/pom.xml
+++ b/aggregates/jetty-websocket-all/pom.xml
@@ -149,8 +149,8 @@
compile
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
compile
diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml
index 5526de7d7c2c..f33dc95b24a1 100644
--- a/apache-jsp/pom.xml
+++ b/apache-jsp/pom.xml
@@ -73,11 +73,7 @@
org.eclipse.jetty.toolchain
- jetty-schemas
-
-
- javax.servlet
- javax.servlet-api
+ jetty-servlet-api
org.mortbay.jasper
diff --git a/apache-jsp/src/main/java/module-info.java b/apache-jsp/src/main/java/module-info.java
index 6eee2fea064b..4fd2e75a50d5 100644
--- a/apache-jsp/src/main/java/module-info.java
+++ b/apache-jsp/src/main/java/module-info.java
@@ -30,7 +30,7 @@
requires java.xml;
requires org.eclipse.jetty.util;
requires org.mortbay.apache.jasper;
- requires static javax.servlet.api;
+ requires static jetty.servlet.api;
provides Log with JuliLog;
provides ServletContainerInitializer with JettyJasperInitializer;
diff --git a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
index f0d7d8ad5f46..26196e0ec9a2 100644
--- a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
+++ b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
@@ -33,7 +33,7 @@ public static void init(WebAppContext context, URI baseUri, File scratchDir)
{
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
+ ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
context.setWar(baseUri.toASCIIString());
context.setResourceBase(baseUri.toASCIIString());
}
diff --git a/examples/async-rest/async-rest-jar/pom.xml b/examples/async-rest/async-rest-jar/pom.xml
index 592c573dc6c3..2b0eb399e060 100644
--- a/examples/async-rest/async-rest-jar/pom.xml
+++ b/examples/async-rest/async-rest-jar/pom.xml
@@ -25,8 +25,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/examples/async-rest/async-rest-webapp/pom.xml b/examples/async-rest/async-rest-webapp/pom.xml
index cad12670d5f2..91bb381eb86c 100644
--- a/examples/async-rest/async-rest-webapp/pom.xml
+++ b/examples/async-rest/async-rest-webapp/pom.xml
@@ -19,8 +19,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
index 8a3fdcb90cfd..709b726414a2 100644
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
@@ -53,7 +53,7 @@ public static final void main( String args[] ) throws Exception
webapp.setWar(warFile.getAbsolutePath());
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$");
+ ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$");
server.setHandler(webapp);
// Register new transaction manager in JNDI
diff --git a/jetty-annotations/src/main/java/module-info.java b/jetty-annotations/src/main/java/module-info.java
index 2df3534a1430..4934e5d17350 100644
--- a/jetty-annotations/src/main/java/module-info.java
+++ b/jetty-annotations/src/main/java/module-info.java
@@ -27,7 +27,7 @@
requires java.naming;
requires java.annotation;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.objectweb.asm;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
diff --git a/jetty-ant/src/test/config/build.xml b/jetty-ant/src/test/config/build.xml
index 9ca5fedf5bdc..49244b5df9ff 100644
--- a/jetty-ant/src/test/config/build.xml
+++ b/jetty-ant/src/test/config/build.xml
@@ -29,12 +29,9 @@
-
+
-
-
+
diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml
index 0fc0d39090af..e356cd3d1e75 100644
--- a/jetty-client/pom.xml
+++ b/jetty-client/pom.xml
@@ -20,9 +20,9 @@
@{argLine}
- --add-reads org.eclipse.jetty.client=javax.servlet.api
+ --add-reads org.eclipse.jetty.client=jetty.servlet.api
--add-modules java.security.jgss
- --add-modules javax.servlet.api
+ --add-modules jetty.servlet.api
--add-modules org.eclipse.jetty.jmx
--add-modules org.slf4j
@@ -120,8 +120,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
test
diff --git a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
index b16fbd7101ee..15f43f81210e 100644
--- a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
+++ b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
@@ -11,7 +11,7 @@
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/servlet-api-[^/]*\.jar$
+ .*/[^/]*servlet-api-[^/]*\.jar$
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
index b63440dda76b..d3ce014792c5 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
@@ -66,7 +66,6 @@ Version Information on 11 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
- 1: 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
index 8093141ecb82..8dea8a8793e0 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
@@ -247,7 +247,6 @@ Modules for tag '*':
Depend: threadpool
Optional: jvm, ext, resources, logging
LIB: lib/servlet-api-3.1.jar
- LIB: lib/jetty-schemas-3.1.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
LIB: lib/jetty-xml-${jetty.version}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
index 936341988707..24d549146896 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
@@ -159,7 +159,6 @@ Note: order presented here is how they would appear on the classpath.
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
- 5: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
index 648664e42f6f..89517e4295a8 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
@@ -69,7 +69,6 @@ Note: order presented here is how they would appear on the classpath.
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
- 5: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
index 51f3b6b29840..69b872b7ed52 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
@@ -69,16 +69,13 @@ This will give an output looking something like this (broken in sections for cla
[source, screen, subs="{sub-order}"]
....
/opt/openjdk-11+28/bin/java
---module-path /opt/jetty/lib/servlet-api-3.1.jar:/opt/jetty/lib/jetty-schemas-3.1.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
---patch-module servlet.api=/opt/jetty/lib/jetty-schemas-3.1.jar
+--module-path /opt/jetty/lib/jetty-servlet-api-4.0.0.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
--module org.eclipse.jetty.xml/org.eclipse.jetty.xml.XmlConfiguration /opt/jetty/etc/jetty-threadpool.xml /opt/jetty/etc/jetty.xml ...
....
The `--module-path` option specifies the list of Jetty jars.
This list depends on the Jetty modules that have been enabled via the link:#startup-modules[`--add-to-start`] command.
-The `--patch-module` option is necessary for Servlet and JSP Containers to find XML DTDs and XML Schemas required to validate the various XML files present in web applications (such as `web.xml` and others).
-
The `--module` option tells the JVM to run main class `XmlConfiguration` from the `org.eclipse.jetty.xml` module, with the given XML files as program arguments.
When the JVM starts, module `org.eclipse.jetty.xml` is added to the set of JPMS _root modules_; all other Jetty modules, being automatic, will be resolved and added to the module graph.
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
index 6193508a0760..9fe6b61d694f 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
@@ -163,7 +163,6 @@ Version Information on 7 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
- 1: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
@@ -193,7 +192,6 @@ The following is the equivalent Java command line for what the `start.jar` boots
-Djetty.base=$JETTY_BASE \
-cp \
$JETTY_HOME/lib/servlet-api-3.1.jar\
-:$JETTY_HOME/lib/jetty-schemas-3.1.jar\
:$JETTY_HOME/lib/jetty-http-$JETTY_VERSION.jar\
:$JETTY_HOME/lib/jetty-server-$JETTY_VERSION.jar \
:$JETTY_HOME/lib/jetty-xml-$JETTY_VERSION.jar\
diff --git a/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc b/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
index 2aeb1174b03b..1e3f118cca7c 100644
--- a/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
+++ b/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
@@ -210,7 +210,6 @@ Version Information on 11 entries in the classpath.
: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
- 1: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
@@ -385,7 +384,6 @@ Module: security
Module: server
LIB: lib/servlet-api-3.1.jar
- LIB: lib/jetty-schemas-3.1.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-continuation-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
diff --git a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
index a0fd6bacc421..9ec12c038dc7 100644
--- a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
+++ b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
@@ -324,7 +324,7 @@ Defaults to "true".
Controls whether any overlaid wars are added before or after the original base resource(s) of the webapp.
See the section on link:#using-overlaid-wars[overlaid wars] for more information.
containerIncludeJarPattern;;
-Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
+Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/[^/]*servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
This is a pattern that is applied to the names of the jars on the container's classpath (ie the classpath of the plugin, not that of the webapp) that should be scanned for fragments, tlds, annotations etc.
This is analogous to the context attribute link:#container-include-jar-pattern[org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern] that is documented link:#container-include-jar-pattern[here].
You can define extra patterns of jars that will be included in the scan.
diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml
index 6b1ba00392be..725e33083042 100644
--- a/jetty-fcgi/fcgi-server/pom.xml
+++ b/jetty-fcgi/fcgi-server/pom.xml
@@ -21,8 +21,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
org.eclipse.jetty.fcgi
diff --git a/jetty-fcgi/fcgi-server/src/main/java/module-info.java b/jetty-fcgi/fcgi-server/src/main/java/module-info.java
index 1632a75a0b44..052e45b25cd7 100644
--- a/jetty-fcgi/fcgi-server/src/main/java/module-info.java
+++ b/jetty-fcgi/fcgi-server/src/main/java/module-info.java
@@ -21,7 +21,7 @@
exports org.eclipse.jetty.fcgi.server;
exports org.eclipse.jetty.fcgi.server.proxy;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml
index 5a0e6c12012f..9fc9350dedee 100644
--- a/jetty-home/pom.xml
+++ b/jetty-home/pom.xml
@@ -284,21 +284,13 @@
-
- javax.servlet
- javax.servlet-api
- ${servlet.api.version}
- true
- ${assembly-directory}/lib
- servlet-api-4.0.jar
-
org.eclipse.jetty.toolchain
- jetty-schemas
- ${servlet.schema.version}
+ jetty-servlet-api
+ ${servlet.api.version}
true
${assembly-directory}/lib
- jetty-schemas-4.0.jar
+ jetty-servlet-api-${servlet.api.version}.jar
diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml
index d18cafe4a8fb..3d6f0580d0d8 100644
--- a/jetty-http/pom.xml
+++ b/jetty-http/pom.xml
@@ -27,8 +27,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
@@ -44,7 +44,7 @@
maven-surefire-plugin
- @{argLine} --add-modules javax.servlet.api
+ @{argLine} --add-modules jetty.servlet.api
diff --git a/jetty-http/src/main/java/module-info.java b/jetty-http/src/main/java/module-info.java
index 43ad7b78ddd1..1c4e6ee3c057 100644
--- a/jetty-http/src/main/java/module-info.java
+++ b/jetty-http/src/main/java/module-info.java
@@ -26,7 +26,7 @@
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.io;
- requires static javax.servlet.api;
+ requires static jetty.servlet.api;
uses HttpFieldPreEncoder;
diff --git a/jetty-http2/http2-client/pom.xml b/jetty-http2/http2-client/pom.xml
index 733ae5a100d3..40e7c02386e7 100644
--- a/jetty-http2/http2-client/pom.xml
+++ b/jetty-http2/http2-client/pom.xml
@@ -22,8 +22,8 @@
@{argLine}
- --add-reads org.eclipse.jetty.http2.client=javax.servlet.api
- --add-modules javax.servlet.api
+ --add-reads org.eclipse.jetty.http2.client=jetty.servlet.api
+ --add-modules jetty.servlet.api
diff --git a/jetty-http2/http2-http-client-transport/pom.xml b/jetty-http2/http2-http-client-transport/pom.xml
index c0eff88e3bee..abd4d78f91f5 100644
--- a/jetty-http2/http2-http-client-transport/pom.xml
+++ b/jetty-http2/http2-http-client-transport/pom.xml
@@ -22,8 +22,8 @@
@{argLine}
- --add-reads org.eclipse.jetty.http2.http.client.transport=javax.servlet.api
- --add-modules javax.servlet.api
+ --add-reads org.eclipse.jetty.http2.http.client.transport=jetty.servlet.api
+ --add-modules jetty.servlet.api
diff --git a/jetty-http2/http2-server/pom.xml b/jetty-http2/http2-server/pom.xml
index 98cccc400193..12523304c703 100644
--- a/jetty-http2/http2-server/pom.xml
+++ b/jetty-http2/http2-server/pom.xml
@@ -22,8 +22,8 @@
@{argLine}
- --add-reads org.eclipse.jetty.http2.server=javax.servlet.api
- --add-modules javax.servlet.api
+ --add-reads org.eclipse.jetty.http2.server=jetty.servlet.api
+ --add-modules jetty.servlet.api
diff --git a/jetty-jaas/src/main/java/module-info.java b/jetty-jaas/src/main/java/module-info.java
index 90453ec31281..95f6eeb1a8b4 100644
--- a/jetty-jaas/src/main/java/module-info.java
+++ b/jetty-jaas/src/main/java/module-info.java
@@ -23,7 +23,7 @@
exports org.eclipse.jetty.jaas.spi;
requires java.naming;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.server;
requires org.eclipse.jetty.security;
diff --git a/jetty-jaspi/src/main/java/module-info.java b/jetty-jaspi/src/main/java/module-info.java
index c5f183621b01..11a0242fe032 100644
--- a/jetty-jaspi/src/main/java/module-info.java
+++ b/jetty-jaspi/src/main/java/module-info.java
@@ -22,7 +22,7 @@
exports org.eclipse.jetty.security.jaspi.callback;
exports org.eclipse.jetty.security.jaspi.modules;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires javax.security.auth.message;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
diff --git a/jetty-maven-plugin/src/it/it-parent-pom/pom.xml b/jetty-maven-plugin/src/it/it-parent-pom/pom.xml
index 1336aa212e3a..e2abaea00013 100644
--- a/jetty-maven-plugin/src/it/it-parent-pom/pom.xml
+++ b/jetty-maven-plugin/src/it/it-parent-pom/pom.xml
@@ -21,8 +21,8 @@
2.6
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
@servlet.api.version@
provided
diff --git a/jetty-maven-plugin/src/it/jetty-cdi-run-forked/pom.xml b/jetty-maven-plugin/src/it/jetty-cdi-run-forked/pom.xml
index 0933746e86a6..6787fc1d4369 100644
--- a/jetty-maven-plugin/src/it/jetty-cdi-run-forked/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-cdi-run-forked/pom.xml
@@ -25,8 +25,8 @@
weld-servlet
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/pom.xml b/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/pom.xml
index 22b6754fa9ee..69a29e1e4377 100755
--- a/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/pom.xml
@@ -18,8 +18,8 @@
provided
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-base/pom.xml
index fdcc1c714000..f6e2fd01cc4c 100644
--- a/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-base/pom.xml
@@ -15,11 +15,9 @@
Jetty :: Simple :: Base
-
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-run-forked-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-run-forked-mojo-it/jetty-simple-base/pom.xml
index 10adc6ec1c05..b44e131b87da 100644
--- a/jetty-maven-plugin/src/it/jetty-run-forked-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-run-forked-mojo-it/jetty-simple-base/pom.xml
@@ -16,9 +16,8 @@
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-run-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-run-mojo-it/jetty-simple-base/pom.xml
index 05c9b0335f07..2bebc902d0bc 100644
--- a/jetty-maven-plugin/src/it/jetty-run-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-run-mojo-it/jetty-simple-base/pom.xml
@@ -16,9 +16,8 @@
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-run-war-exploded-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-run-war-exploded-mojo-it/jetty-simple-base/pom.xml
index 1fa6323df0fa..ebca593cdc46 100644
--- a/jetty-maven-plugin/src/it/jetty-run-war-exploded-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-run-war-exploded-mojo-it/jetty-simple-base/pom.xml
@@ -16,9 +16,8 @@
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml
index 0269200449ef..aa635b3af2ad 100644
--- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml
@@ -16,9 +16,8 @@
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/jetty-start-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-start-mojo-it/jetty-simple-base/pom.xml
index dbefb81281d3..399a0f4639f4 100644
--- a/jetty-maven-plugin/src/it/jetty-start-mojo-it/jetty-simple-base/pom.xml
+++ b/jetty-maven-plugin/src/it/jetty-start-mojo-it/jetty-simple-base/pom.xml
@@ -16,9 +16,8 @@
- javax.servlet
- javax.servlet-api
- jar
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/it/run-mojo-gwt-it/beer-server/pom.xml b/jetty-maven-plugin/src/it/run-mojo-gwt-it/beer-server/pom.xml
index 9e6afd3bd7a3..1417ac272636 100644
--- a/jetty-maven-plugin/src/it/run-mojo-gwt-it/beer-server/pom.xml
+++ b/jetty-maven-plugin/src/it/run-mojo-gwt-it/beer-server/pom.xml
@@ -26,8 +26,8 @@
gwt-servlet
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
index 8ee3b205367a..3c3a168dfa87 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
@@ -62,7 +62,7 @@ public class JettyWebAppContext extends WebAppContext
{
private static final Logger LOG = Log.getLogger(JettyWebAppContext.class);
- private static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar";
+ private static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar";
private static final String WEB_INF_CLASSES_PREFIX = "/WEB-INF/classes";
diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
index cdd302d168f8..853c7db1d2d7 100644
--- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
@@ -33,8 +33,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml
index 0499f0742fde..3f8808902f75 100644
--- a/jetty-osgi/jetty-osgi-httpservice/pom.xml
+++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml
@@ -31,8 +31,8 @@
provided
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml
index 834a32fbfa03..2202e3c93a2f 100644
--- a/jetty-osgi/test-jetty-osgi-context/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-context/pom.xml
@@ -28,10 +28,6 @@
org.eclipse.osgi.services
provided
-
- org.eclipse.jetty.toolchain
- jetty-schemas
-
diff --git a/jetty-osgi/test-jetty-osgi-server/pom.xml b/jetty-osgi/test-jetty-osgi-server/pom.xml
index 9e481ce7cc2f..b47c195df90d 100644
--- a/jetty-osgi/test-jetty-osgi-server/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-server/pom.xml
@@ -28,10 +28,6 @@
org.eclipse.osgi.services
provided
-
- org.eclipse.jetty.toolchain
- jetty-schemas
-
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index b18305c56195..83c6ebc86aa4 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -336,11 +336,6 @@
${project.version}
test
-
- org.eclipse.jetty.toolchain
- jetty-schemas
- runtime
-
org.eclipse.jetty
jetty-plus
diff --git a/jetty-plus/src/main/java/module-info.java b/jetty-plus/src/main/java/module-info.java
index 9e9c95713600..756b5b5b27bf 100644
--- a/jetty-plus/src/main/java/module-info.java
+++ b/jetty-plus/src/main/java/module-info.java
@@ -35,7 +35,7 @@
requires org.eclipse.jetty.webapp;
requires org.eclipse.jetty.xml;
requires static java.sql;
- requires static javax.servlet.api;
+ requires static jetty.servlet.api;
requires static org.eclipse.jetty.server;
requires static org.eclipse.jetty.servlet;
diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml
index e11616afd14c..6d42eb1d74d9 100644
--- a/jetty-proxy/pom.xml
+++ b/jetty-proxy/pom.xml
@@ -29,8 +29,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-proxy/src/main/java/module-info.java b/jetty-proxy/src/main/java/module-info.java
index 15726e41ef22..839950945e01 100644
--- a/jetty-proxy/src/main/java/module-info.java
+++ b/jetty-proxy/src/main/java/module-info.java
@@ -20,7 +20,7 @@
{
exports org.eclipse.jetty.proxy;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
diff --git a/jetty-quickstart/pom.xml b/jetty-quickstart/pom.xml
index 7c1aa1979ca4..5201a06d0538 100644
--- a/jetty-quickstart/pom.xml
+++ b/jetty-quickstart/pom.xml
@@ -13,23 +13,8 @@
${project.groupId}.quickstart
- ${settings.localRepository}/org/eclipse/jetty/toolchain/jetty-schemas/${servlet.schema.version}/jetty-schemas-${servlet.schema.version}.jar
-
-
-
- maven-surefire-plugin
-
-
- @{argLine}
- --patch-module javax.servlet.api=${jetty-schemas-jar}
-
-
-
-
-
-
org.eclipse.jetty
diff --git a/jetty-quickstart/src/main/java/module-info.java b/jetty-quickstart/src/main/java/module-info.java
index 51ef5bd10ce4..dfbf1da472d4 100644
--- a/jetty-quickstart/src/main/java/module-info.java
+++ b/jetty-quickstart/src/main/java/module-info.java
@@ -20,7 +20,7 @@
{
exports org.eclipse.jetty.quickstart;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.annotations;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
diff --git a/jetty-rewrite/pom.xml b/jetty-rewrite/pom.xml
index 9240dcdc9303..a40e4b0e9d77 100644
--- a/jetty-rewrite/pom.xml
+++ b/jetty-rewrite/pom.xml
@@ -34,8 +34,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
diff --git a/jetty-rewrite/src/main/java/module-info.java b/jetty-rewrite/src/main/java/module-info.java
index e707d547d532..a10478318de5 100644
--- a/jetty-rewrite/src/main/java/module-info.java
+++ b/jetty-rewrite/src/main/java/module-info.java
@@ -21,7 +21,7 @@
exports org.eclipse.jetty.rewrite;
exports org.eclipse.jetty.rewrite.handler;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
diff --git a/jetty-security/src/main/java/module-info.java b/jetty-security/src/main/java/module-info.java
index c0308bdcc945..757fef25996f 100644
--- a/jetty-security/src/main/java/module-info.java
+++ b/jetty-security/src/main/java/module-info.java
@@ -21,7 +21,7 @@
exports org.eclipse.jetty.security;
exports org.eclipse.jetty.security.authentication;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.server;
diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml
index c29ba648e512..a49b18098f60 100644
--- a/jetty-server/pom.xml
+++ b/jetty-server/pom.xml
@@ -42,8 +42,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
org.eclipse.jetty
diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod
index bf31c6bb2a4d..3a29b1b8995c 100644
--- a/jetty-server/src/main/config/modules/server.mod
+++ b/jetty-server/src/main/config/modules/server.mod
@@ -13,8 +13,7 @@ logging
threadpool
[lib]
-lib/servlet-api-4.0.jar
-lib/jetty-schemas-4.0.jar
+lib/jetty-servlet-api-4.0.0-SNAPSHOT.jar
lib/jetty-http-${jetty.version}.jar
lib/jetty-server-${jetty.version}.jar
lib/jetty-xml-${jetty.version}.jar
@@ -24,9 +23,6 @@ lib/jetty-io-${jetty.version}.jar
[xml]
etc/jetty.xml
-[jpms]
-patch-module: servlet.api=lib/jetty-schemas-${servlet.schema.version}.jar
-
[ini-template]
### Common HTTP configuration
## Scheme to use to build URIs for secure redirects
diff --git a/jetty-server/src/main/java/module-info.java b/jetty-server/src/main/java/module-info.java
index 9111f0131087..7a4fe00a71e8 100644
--- a/jetty-server/src/main/java/module-info.java
+++ b/jetty-server/src/main/java/module-info.java
@@ -25,7 +25,7 @@
exports org.eclipse.jetty.server.handler.jmx to org.eclipse.jetty.jmx;
exports org.eclipse.jetty.server.session;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
diff --git a/jetty-servlet/src/main/java/module-info.java b/jetty-servlet/src/main/java/module-info.java
index d34df7042864..7b5dc57327a1 100644
--- a/jetty-servlet/src/main/java/module-info.java
+++ b/jetty-servlet/src/main/java/module-info.java
@@ -22,7 +22,7 @@
exports org.eclipse.jetty.servlet.jmx to org.eclipse.jetty.jmx;
exports org.eclipse.jetty.servlet.listener;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.server;
diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml
index d45b9b35d1d8..f19d89e71ac0 100644
--- a/jetty-servlets/pom.xml
+++ b/jetty-servlets/pom.xml
@@ -24,7 +24,7 @@
@{argLine}
- --add-modules javax.servlet.api
+ --add-modules jetty.servlet.api
--add-modules org.eclipse.jetty.util
--add-modules org.eclipse.jetty.io
--add-modules org.eclipse.jetty.http
@@ -63,8 +63,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-servlets/src/main/java/module-info.java b/jetty-servlets/src/main/java/module-info.java
index a8b2ebce89fc..f908755c484e 100644
--- a/jetty-servlets/src/main/java/module-info.java
+++ b/jetty-servlets/src/main/java/module-info.java
@@ -20,7 +20,7 @@
{
exports org.eclipse.jetty.servlets;
- requires static javax.servlet.api;
+ requires static jetty.servlet.api;
requires static org.eclipse.jetty.util;
requires static org.eclipse.jetty.io;
requires static org.eclipse.jetty.http;
diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml
index 0cea72acb56f..6fcf4b1e14fa 100644
--- a/jetty-util-ajax/pom.xml
+++ b/jetty-util-ajax/pom.xml
@@ -30,8 +30,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml
index 1f0e5bbaebb7..a6fed7cb0fc7 100644
--- a/jetty-util/pom.xml
+++ b/jetty-util/pom.xml
@@ -64,7 +64,7 @@
${settings.localRepository}
- @{argLine} --add-modules javax.servlet.api,org.slf4j
+ @{argLine} --add-modules jetty.servlet.api,org.slf4j
@@ -72,8 +72,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/jetty-util/src/main/java/module-info.java b/jetty-util/src/main/java/module-info.java
index 5db68242ff49..6744f628530f 100644
--- a/jetty-util/src/main/java/module-info.java
+++ b/jetty-util/src/main/java/module-info.java
@@ -37,7 +37,7 @@
requires static java.logging;
requires static java.sql;
requires static java.xml;
- requires static javax.servlet.api;
+ requires static jetty.servlet.api;
requires static org.slf4j;
uses CredentialProvider;
diff --git a/jetty-webapp/src/main/java/module-info.java b/jetty-webapp/src/main/java/module-info.java
index d4c93900cc46..93dbde561dc3 100644
--- a/jetty-webapp/src/main/java/module-info.java
+++ b/jetty-webapp/src/main/java/module-info.java
@@ -24,7 +24,7 @@
requires java.instrument;
requires java.xml;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.security;
diff --git a/jetty-websocket/javax-websocket-server/src/main/java/module-info.java b/jetty-websocket/javax-websocket-server/src/main/java/module-info.java
index 7a0804d52749..931536697819 100644
--- a/jetty-websocket/javax-websocket-server/src/main/java/module-info.java
+++ b/jetty-websocket/javax-websocket-server/src/main/java/module-info.java
@@ -28,7 +28,7 @@
{
exports org.eclipse.jetty.websocket.jsr356.server;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires javax.websocket.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
diff --git a/jetty-websocket/jetty-websocket-server/pom.xml b/jetty-websocket/jetty-websocket-server/pom.xml
index 3baa91b36134..a3d648667fe8 100644
--- a/jetty-websocket/jetty-websocket-server/pom.xml
+++ b/jetty-websocket/jetty-websocket-server/pom.xml
@@ -48,8 +48,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
diff --git a/jetty-websocket/jetty-websocket-server/src/main/java/module-info.java b/jetty-websocket/jetty-websocket-server/src/main/java/module-info.java
index bd20f4573f33..b2240d89e245 100644
--- a/jetty-websocket/jetty-websocket-server/src/main/java/module-info.java
+++ b/jetty-websocket/jetty-websocket-server/src/main/java/module-info.java
@@ -26,7 +26,7 @@
{
exports org.eclipse.jetty.websocket.server;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.servlet;
requires org.eclipse.jetty.webapp;
diff --git a/jetty-websocket/websocket-core/pom.xml b/jetty-websocket/websocket-core/pom.xml
index d02d69eddc5f..bf3087e63b95 100644
--- a/jetty-websocket/websocket-core/pom.xml
+++ b/jetty-websocket/websocket-core/pom.xml
@@ -87,6 +87,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/websocket-core/src/main/java/module-info.java b/jetty-websocket/websocket-core/src/main/java/module-info.java
index a95176297cd9..fa1986800a2c 100644
--- a/jetty-websocket/websocket-core/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-core/src/main/java/module-info.java
@@ -32,7 +32,7 @@
exports org.eclipse.jetty.websocket.core.internal to org.eclipse.jetty.util;
exports org.eclipse.jetty.websocket.core.internal.compress to org.eclipse.jetty.util;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.io;
requires org.eclipse.jetty.http;
diff --git a/jetty-websocket/websocket-servlet/src/main/java/module-info.java b/jetty-websocket/websocket-servlet/src/main/java/module-info.java
index 7ae0f2c0cbe2..b6b6f05e453c 100644
--- a/jetty-websocket/websocket-servlet/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-servlet/src/main/java/module-info.java
@@ -20,7 +20,7 @@
{
exports org.eclipse.jetty.websocket.servlet;
- requires javax.servlet.api;
+ requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
diff --git a/pom.xml b/pom.xml
index b398cc6c88fc..e8cc1ce656ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,8 +48,7 @@
1.2.3
5.1.1.RELEASE
1.2
- 4.0.1
- 4.0.3
+ 4.0.0-SNAPSHOT
8.5.33
undefined
@@ -892,9 +891,9 @@
- javax.servlet
- javax.servlet-api
- ${servlet.api.version}
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
+ ${servlet.api.version}
javax.websocket
@@ -932,11 +931,6 @@
1.0.0.v201108011116
-
- org.eclipse.jetty.toolchain
- jetty-schemas
- ${servlet.schema.version}
-
org.mortbay.jasper
apache-jsp
diff --git a/tests/jetty-jmh/pom.xml b/tests/jetty-jmh/pom.xml
index 61bb15457752..3146756e7737 100644
--- a/tests/jetty-jmh/pom.xml
+++ b/tests/jetty-jmh/pom.xml
@@ -89,8 +89,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
org.eclipse.jetty.toolchain
diff --git a/tests/test-integration/src/test/resources/RFC2616Base.xml b/tests/test-integration/src/test/resources/RFC2616Base.xml
index 4d600f7c7b5a..1724b9f72d2f 100644
--- a/tests/test-integration/src/test/resources/RFC2616Base.xml
+++ b/tests/test-integration/src/test/resources/RFC2616Base.xml
@@ -80,7 +80,7 @@
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/servlet-api-[^/]*\.jar$
+ .*/[^/]*servlet-api-[^/]*\.jar$
diff --git a/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java b/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
index 789e606881d9..f94fe6486515 100644
--- a/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
+++ b/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
@@ -45,11 +45,11 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.startsWith;
-import static org.hamcrest.MatcherAssert.assertThat;
@Disabled
public class JmxIT
@@ -94,7 +94,7 @@ public void startJetty() throws Exception
context.addConfiguration(new AnnotationConfiguration());
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$");
+ ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$");
_server.setHandler(context);
MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
diff --git a/tests/test-jmx/jmx-webapp/pom.xml b/tests/test-jmx/jmx-webapp/pom.xml
index 08242d62024f..38445f8c86fb 100644
--- a/tests/test-jmx/jmx-webapp/pom.xml
+++ b/tests/test-jmx/jmx-webapp/pom.xml
@@ -16,8 +16,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/tests/test-webapps/test-http2-webapp/pom.xml b/tests/test-webapps/test-http2-webapp/pom.xml
index 5f1c631ca012..7db6283bc92e 100644
--- a/tests/test-webapps/test-http2-webapp/pom.xml
+++ b/tests/test-webapps/test-http2-webapp/pom.xml
@@ -63,9 +63,9 @@
${project.version}
- javax.servlet
- javax.servlet-api
- provided
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
+ provided
org.eclipse.jetty
diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml
index 02a23f705fe7..01075539b3ef 100644
--- a/tests/test-webapps/test-jetty-webapp/pom.xml
+++ b/tests/test-webapps/test-jetty-webapp/pom.xml
@@ -143,8 +143,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml
index 649bc2e37443..dc65328ed212 100644
--- a/tests/test-webapps/test-jndi-webapp/pom.xml
+++ b/tests/test-webapps/test-jndi-webapp/pom.xml
@@ -117,11 +117,11 @@
javax.transaction-api
provided
-
- javax.servlet
- javax.servlet-api
- provided
-
+
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
+ provided
+
org.eclipse.jetty.orbit
javax.mail.glassfish
diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml
index f9a15cc57c50..a4eb8672234a 100644
--- a/tests/test-webapps/test-mock-resources/pom.xml
+++ b/tests/test-webapps/test-mock-resources/pom.xml
@@ -49,8 +49,8 @@
provided
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml
index eb339f6a695c..5dd0f619c08f 100644
--- a/tests/test-webapps/test-proxy-webapp/pom.xml
+++ b/tests/test-webapps/test-proxy-webapp/pom.xml
@@ -41,9 +41,9 @@
${project.version}
- javax.servlet
- javax.servlet-api
- provided
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
+ provided
diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml
index 62859f26f39d..2bcff72d3ff2 100644
--- a/tests/test-webapps/test-webapp-rfc2616/pom.xml
+++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml
@@ -48,8 +48,8 @@
${project.version}
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
provided
From 707c9ec322a39e468e3cba31866d2b6b603eb9ab Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 29 Nov 2018 17:29:08 +0100
Subject: [PATCH 02/35] Issue #3162 - Use Jetty specific Servlet API jar.
Future proof reference of the jetty-servlet-api.jar.
Signed-off-by: Simone Bordet
---
jetty-server/src/main/config/modules/server.mod | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod
index 3a29b1b8995c..d10d42f2c8f8 100644
--- a/jetty-server/src/main/config/modules/server.mod
+++ b/jetty-server/src/main/config/modules/server.mod
@@ -13,7 +13,7 @@ logging
threadpool
[lib]
-lib/jetty-servlet-api-4.0.0-SNAPSHOT.jar
+lib/jetty-servlet-api-4.*.jar
lib/jetty-http-${jetty.version}.jar
lib/jetty-server-${jetty.version}.jar
lib/jetty-xml-${jetty.version}.jar
From 8ff82423f90ce48fcad324c0d9f5bbc60e0ccfa2 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 29 Nov 2018 17:36:09 +0100
Subject: [PATCH 03/35] Issue #3162 - Use Jetty specific Servlet API jar.
Removed references to jetty-osgi-servlet-api.
Signed-off-by: Simone Bordet
---
.../asciidoc/development/frameworks/osgi.adoc | 2 +-
jetty-osgi/test-jetty-osgi/pom.xml | 3 +--
.../eclipse/jetty/osgi/test/TestOSGiUtil.java | 17 ++++++++---------
3 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
index f6290572cf71..827d5278dbee 100644
--- a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
+++ b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
@@ -45,7 +45,7 @@ Here's the absolute minimal set of Jetty jars:
|jetty-webapp |org.eclipse.jetty.webapp
|jetty-deploy |org.eclipse.jetty.deploy
|jetty-xml |org.eclipse.jetty.xml
-|jetty-osgi-servlet-api |org.eclipse.jetty.osgi-servlet-api
+|jetty-servlet-api |org.eclipse.jetty.servlet-api
|===================================================
You *must also install the Apache Aries SPI Fly bundles* as many parts of Jetty - for example ALPN, websocket, annotations - use the `ServiceLoader` mechanism, which requires an OSGi Service Loader Mediator like SPI Fly:
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index 83c6ebc86aa4..0ea55a8781e1 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -134,8 +134,7 @@
org.eclipse.jetty.toolchain
- jetty-osgi-servlet-api
- 4.0.1
+ jetty-servlet-api
org.apache.geronimo.specs
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index b541adcf7547..6ad30ce3f703 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -18,13 +18,6 @@
package org.eclipse.jetty.osgi.test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -44,7 +37,6 @@
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.osgi.framework.Bundle;
@@ -52,6 +44,13 @@
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
/**
* Helper methods for pax-exam tests
*/
@@ -107,7 +106,7 @@ public static List coreJettyDependencies()
String mavenRepoPath = System.getProperty( "mavenRepoPath" );
if (!StringUtil.isBlank(mavenRepoPath))
res.add( systemProperty( "org.ops4j.pax.url.mvn.localRepository" ).value( mavenRepoPath ) );
- res.add(mavenBundle().groupId( "org.eclipse.jetty.toolchain" ).artifactId( "jetty-osgi-servlet-api" ).versionAsInProject().start());
+ res.add(mavenBundle().groupId( "org.eclipse.jetty.toolchain" ).artifactId( "jetty-servlet-api" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.ow2.asm" ).artifactId( "asm" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.ow2.asm" ).artifactId( "asm-commons" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.ow2.asm" ).artifactId( "asm-tree" ).versionAsInProject().start());
From c3348a0a0389feb587bcb2e4d6a3d4019cdd22be Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Fri, 30 Nov 2018 15:03:44 -0600
Subject: [PATCH 04/35] Issue #3162 - Correcting websocket issues in OSGi
Signed-off-by: Joakim Erdfelt
---
jetty-osgi/test-jetty-osgi/pom.xml | 6 +++---
.../config/etc/jetty-with-custom-class.xml | 4 ++--
.../src/test/config/etc/jetty.xml | 4 ++--
.../jetty/osgi/test/SimpleEchoSocket.java | 18 ++++++++----------
.../test/TestJettyOSGiBootWithWebSocket.java | 1 +
.../eclipse/jetty/osgi/test/TestOSGiUtil.java | 7 ++++++-
pom.xml | 2 +-
7 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index 0ea55a8781e1..a175396f3300 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -14,8 +14,8 @@
${project.groupId}.boot.test.osgi
http://download.eclipse.org/jetty/orbit/
target/distribution
- 4.12.0
- 2.5.2
+ 4.13.0
+ 2.5.4
1.0
@@ -65,7 +65,7 @@
org.ops4j.pax.url
pax-url-wrap
- 2.5.4
+ ${url.version}
test
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
index 80743f54f8d4..d075687ed69a 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
@@ -81,9 +81,9 @@
- org.eclipse.jetty.plus.webapp.PlusConfiguration
- org.eclipse.jetty.plus.webapp.EnvConfiguration
- org.eclipse.jetty.webapp.JmxConfiguration
- - org.eclipse.jetty.websocket.server.JettyWebSocketConfiguration
- - org.eclipse.jetty.websocket.jsr356.JavaxWebSocketExtensionConfig
- org.eclipse.jetty.osgi.annotations.AnnotationConfiguration
+ - org.eclipse.jetty.websocket.server.JettyWebSocketConfiguration
+ - org.eclipse.jetty.websocket.jsr356.server.JavaxWebSocketConfiguration
- org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration
- org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
index 047c127f112a..46512b3a7017 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
@@ -85,9 +85,9 @@
- org.eclipse.jetty.plus.webapp.PlusConfiguration
- org.eclipse.jetty.plus.webapp.EnvConfiguration
- org.eclipse.jetty.webapp.JmxConfiguration
- - org.eclipse.jetty.websocket.server.JettyWebSocketConfiguration
- - org.eclipse.jetty.websocket.jsr356.JavaxWebSocketExtensionConfig
- org.eclipse.jetty.osgi.annotations.AnnotationConfiguration
+ - org.eclipse.jetty.websocket.server.JettyWebSocketConfiguration
+ - org.eclipse.jetty.websocket.jsr356.server.JavaxWebSocketConfiguration
- org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration
- org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
index 3c21433eb9ea..d7c18b00a927 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
@@ -19,9 +19,10 @@
package org.eclipse.jetty.osgi.test;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
@@ -35,6 +36,7 @@
@WebSocket(maxTextMessageSize = 64 * 1024)
public class SimpleEchoSocket
{
+ private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
private final CountDownLatch closeLatch;
@SuppressWarnings("unused")
private Session session;
@@ -52,7 +54,8 @@ public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedExcepti
@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
- //System.out.printf("Connection closed: %d - %s%n",statusCode,reason);
+ LOG.debug("Connection closed: {} - {}", statusCode, reason);
+
this.session = null;
this.closeLatch.countDown(); // trigger latch
}
@@ -60,16 +63,11 @@ public void onClose(int statusCode, String reason)
@OnWebSocketConnect
public void onConnect(Session session)
{
- //System.out.printf("Got connect: %s%n",session);
+ LOG.debug("Got connect: {}", session);
this.session = session;
try
{
- Future fut;
- //System.err.println("Sending Foo!");
- fut = session.getRemote().sendStringByFuture("Foo");
-
- fut.get(2,TimeUnit.SECONDS); // wait for send to complete.
- //System.err.println("Foo complete");
+ session.getRemote().sendString("Foo");
session.close(StatusCode.NORMAL,"I'm done");
}
@@ -82,6 +80,6 @@ public void onConnect(Session session)
@OnWebSocketMessage
public void onMessage(String msg)
{
- //System.out.printf("Got msg: %s%n",msg);
+ LOG.debug("Got msg: {}", msg);
}
}
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
index 8cc48047f272..e31dd357c388 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
@@ -56,6 +56,7 @@ public class TestJettyOSGiBootWithWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
+ options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 6ad30ce3f703..64810877222c 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -97,7 +97,12 @@ public static List provisionCoreJetty()
res.addAll(coreJettyDependencies());
return res;
}
-
+
+ public static Option optionalRemoteDebug()
+ {
+ return CoreOptions.when(Boolean.getBoolean("pax.exam.debug.remote"))
+ .useOptions(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"));
+ }
public static List coreJettyDependencies()
{
diff --git a/pom.xml b/pom.xml
index e8cc1ce656ae..3cb55a3fcbbd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
1.2.3
5.1.1.RELEASE
1.2
- 4.0.0-SNAPSHOT
+ 4.0.1-SNAPSHOT
8.5.33
undefined
From 85f74f198abedb5b759a7dc8c1d475eaddd34ad2 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:31:51 -0600
Subject: [PATCH 05/35] Issue #3162 - Fixing OSGi manifest for websocket
Signed-off-by: Joakim Erdfelt
---
jetty-websocket/javax-websocket-server/pom.xml | 8 ++++++--
jetty-websocket/jetty-websocket-server/pom.xml | 15 ++++++++++++---
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/jetty-websocket/javax-websocket-server/pom.xml b/jetty-websocket/javax-websocket-server/pom.xml
index 181d5efa747f..0a9f061815cf 100644
--- a/jetty-websocket/javax-websocket-server/pom.xml
+++ b/jetty-websocket/javax-websocket-server/pom.xml
@@ -69,9 +69,13 @@
org.eclipse.jetty.websocket.jsr356.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
- osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
+
+ osgi.extender;
+ filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
+
- osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer,osgi.serviceloader;osgi.serviceloader=javax.websocket.server.ServerEndpointConfig$Configurator
+ osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer,
+ osgi.serviceloader;osgi.serviceloader=javax.websocket.server.ServerEndpointConfig$Configurator
diff --git a/jetty-websocket/jetty-websocket-server/pom.xml b/jetty-websocket/jetty-websocket-server/pom.xml
index a3d648667fe8..bd555d793e38 100644
--- a/jetty-websocket/jetty-websocket-server/pom.xml
+++ b/jetty-websocket/jetty-websocket-server/pom.xml
@@ -61,11 +61,20 @@
true
- Websocket Server API
-
+ Jetty Websocket Server API
- org.eclipse.jetty.websocket.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}",org.eclipse.jetty.websocket.server.pathmap.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}"
+ org.eclipse.jetty.websocket.api.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}"
+
+ org.eclipse.jetty.websocket.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}"
+
+
+ osgi.extender;
+ filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
+
+
+ osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer
+
From e0f4e5a32a54c0bab858406a416d960e3b3ce161 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:32:10 -0600
Subject: [PATCH 06/35] Issue #3162 - correcting typo
Signed-off-by: Joakim Erdfelt
---
.../jetty/websocket/core/server/internal/RFC6455Handshaker.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
index cb6eb31409aa..000dd3dc22e8 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
@@ -145,7 +145,7 @@ public boolean upgradeRequest(WebSocketNegotiator negotiator, HttpServletRequest
// Check for handler
if (handler == null)
{
- LOG.warn("not upgraded: no channel {}", baseRequest);
+ LOG.warn("not upgraded: no frame handler provided {}", baseRequest);
return false;
}
From e16e3f1358fe6211a31f1d8c4d34b0e548ecb373 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:32:27 -0600
Subject: [PATCH 07/35] Issue #3162 - correcting logger name
Signed-off-by: Joakim Erdfelt
---
.../java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java | 2 +-
.../java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java | 2 +-
.../org/eclipse/jetty/osgi/boot/ServiceContextProvider.java | 2 +-
.../java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
index f35c8e237aa3..2461a274861a 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
@@ -44,7 +44,7 @@
*/
public class BundleContextProvider extends AbstractContextProvider implements BundleProvider
{
- private static final Logger LOG = Log.getLogger(AbstractContextProvider.class);
+ private static final Logger LOG = Log.getLogger(BundleContextProvider.class);
private Map _appMap = new HashMap();
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
index 04591fc68d7c..0422435c5a96 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
@@ -43,7 +43,7 @@
*/
public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider
{
- private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class);
+ private static final Logger LOG = Log.getLogger(BundleWebAppProvider.class);
/**
* Map of Bundle to App. Used when a Bundle contains a webapp.
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
index b870188db6c3..6db92814ff79 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
@@ -49,7 +49,7 @@
*/
public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider
{
- private static final Logger LOG = Log.getLogger(AbstractContextProvider.class);
+ private static final Logger LOG = Log.getLogger(ServiceContextProvider.class);
private Map _serviceMap = new HashMap<>();
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
index abb95eb92169..83f35ef3bc39 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
@@ -47,7 +47,7 @@
*/
public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider
{
- private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class);
+ private static final Logger LOG = Log.getLogger(ServiceWebAppProvider.class);
/**
* Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext.
From 7f6add586ed4049764265f4ddab0348135b53aa0 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:32:53 -0600
Subject: [PATCH 08/35] Issue #3162 - Adding missing Configuration reference
Signed-off-by: Joakim Erdfelt
---
.../META-INF/services/org.eclipse.jetty.webapp.Configuration | 1 +
1 file changed, 1 insertion(+)
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
index f67098630268..7bda8437fdf0 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
+++ b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
@@ -1,2 +1,3 @@
org.eclipse.jetty.osgi.annotations.AnnotationConfiguration
org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration
+org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration
From db11be087a5afa435abd32adb537b504b54a7275 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:33:20 -0600
Subject: [PATCH 09/35] Issue #3162 - Updating XML (removing references that
seem to be getting in the way)
Signed-off-by: Joakim Erdfelt
---
.../jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml | 2 ++
.../test-jetty-osgi/src/test/config/etc/jetty-deployer.xml | 2 ++
.../src/test/config/etc/jetty-with-custom-class.xml | 2 +-
jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml | 7 +++----
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml
index 19b3a5db090b..566ed9c686ea 100644
--- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml
+++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-deployer.xml
@@ -12,10 +12,12 @@
+
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
index 19b3a5db090b..f3acb5ecf6e0 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
@@ -12,10 +12,12 @@
+
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
index d075687ed69a..297e0468edbf 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
@@ -66,7 +66,7 @@
-
+
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
index 46512b3a7017..39f47a324c0a 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
@@ -28,13 +28,13 @@
-
-
+
-
-
+
-
-
+
@@ -70,7 +70,6 @@
-
From 01e1f019330bbee738544e39dec66e487a333adb Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:33:51 -0600
Subject: [PATCH 10/35] Issue #3162 - Correcting package name exposure (missing
's')
Signed-off-by: Joakim Erdfelt
---
.../org/eclipse/jetty/annotations/AnnotationConfiguration.java | 2 +-
.../eclipse/jetty/osgi/annotations/AnnotationConfiguration.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java
index 5a11e06bec39..c70de4200b8a 100644
--- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java
+++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java
@@ -100,7 +100,7 @@ public AnnotationConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, FragmentConfiguration.class, PlusConfiguration.class);
addDependents(JettyWebXmlConfiguration.class);
- protectAndExpose("org.eclipse.jetty.util.annotation.");
+ protectAndExpose("org.eclipse.jetty.util.annotations.");
hide("org.objectweb.asm.");
}
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
index a649a79d14b9..0975fabaecaa 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
@@ -74,6 +74,8 @@ public Void call() throws Exception
public AnnotationConfiguration()
{
+ super();
+ protectAndExpose("org.eclipse.jetty.osgi.annotations.");
}
/**
From 231892e276e7c8b47b8804dcbb77665a3c457127 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:34:13 -0600
Subject: [PATCH 11/35] Issue #3162 - Making dependents OSGi aware
Signed-off-by: Joakim Erdfelt
---
.../server/JettyWebSocketConfiguration.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/jetty-websocket/jetty-websocket-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketConfiguration.java b/jetty-websocket/jetty-websocket-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketConfiguration.java
index ca5e1bf77a17..82fc8e85e931 100644
--- a/jetty-websocket/jetty-websocket-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/jetty-websocket-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketConfiguration.java
@@ -48,7 +48,14 @@ public class JettyWebSocketConfiguration extends AbstractConfiguration
public JettyWebSocketConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
- addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+
+ if (isAvailable("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration"))
+ addDependents("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+ else if (isAvailable("org.eclipse.jetty.annotations.AnnotationConfiguration"))
+ addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+ else
+ throw new RuntimeException("Unable to add AnnotationConfiguration dependent (not present in classpath)");
+
protectAndExpose(
"org.eclipse.jetty.websocket.api.",
"org.eclipse.jetty.websocket.common.",
@@ -58,10 +65,15 @@ public JettyWebSocketConfiguration()
@Override
public boolean isAvailable()
+ {
+ return isAvailable("org.eclipse.jetty.websocket.common.JettyWebSocketFrame");
+ }
+
+ private boolean isAvailable(String classname)
{
try
{
- return Loader.loadClass("org.eclipse.jetty.websocket.common.JettyWebSocketFrame") != null;
+ return Loader.loadClass(classname) != null;
}
catch (Throwable e)
{
From 24e680e27223be01f18e2a6876b68e9effef3a57 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:35:08 -0600
Subject: [PATCH 12/35] Issue #3162 - Introducing more convenience Options for
PaxExam
Signed-off-by: Joakim Erdfelt
---
.../test/TestJettyOSGiBootWithWebSocket.java | 7 ++---
.../eclipse/jetty/osgi/test/TestOSGiUtil.java | 31 ++++++++++++++-----
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
index e31dd357c388..0007a54f7b41 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
@@ -57,6 +57,7 @@ public static Option[] configure()
{
ArrayList options = new ArrayList<>();
options.add(TestOSGiUtil.optionalRemoteDebug());
+ options.addAll(TestOSGiUtil.jettyLogging());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
@@ -69,6 +70,7 @@ public static Option[] configure()
options.add(systemProperty("org.eclipse.jetty.LEVEL").value(LOG_LEVEL));
options.addAll(jspDependencies());
options.addAll(annotationDependencies());
+ options.add(CoreOptions.cleanCaches(true));
return options.toArray(new Option[options.size()]);
}
@@ -95,21 +97,18 @@ public void assertAllBundlesActiveOrResolved()
TestOSGiUtil.debugBundles(bundleContext);
}
-
-
@Test
public void testWebsocket() throws Exception
{
String port = System.getProperty("boot.websocket.port");
assertNotNull(port);
- URI uri = new URI("ws://127.0.0.1:" + port+"/ws/foo");
+ URI uri = new URI("ws://127.0.0.1:" + port + "/ws/foo");
WebSocketClient client = new WebSocketClient();
try
{
-
SimpleEchoSocket socket = new SimpleEchoSocket();
client.start();
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 64810877222c..37f5fc5e0f80 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -18,6 +18,13 @@
package org.eclipse.jetty.osgi.test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -36,6 +43,7 @@
import org.eclipse.jetty.osgi.boot.OSGiServerConstants;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.util.log.StdErrLog;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
@@ -44,13 +52,6 @@
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
/**
* Helper methods for pax-exam tests
*/
@@ -280,6 +281,22 @@ protected static SslContextFactory newSslContextFactory()
return sslContextFactory;
}
+ public static List jettyLogging()
+ {
+ List options = new ArrayList<>();
+ // SLF4J Specific (possible set of options)
+ /*
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").versionAsInProject().start());
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("jul-to-slf4j").versionAsInProject().start());
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-log4j12").versionAsInProject().start());
+ options.add(mavenBundle().groupId("log4j").artifactId("log4j").versionAsInProject().start());
+ options.add(systemProperty("org.eclipse.jetty.util.log.class").value(Slf4jLog.class.getName()));
+ */
+ options.add(systemProperty("org.eclipse.jetty.util.log.class").value(StdErrLog.class.getName()));
+ options.add(systemProperty("org.eclipse.jetty.LEVEL").value("INFO"));
+ return options;
+ }
+
protected static void testHttpServiceGreetings(BundleContext bundleContext, String protocol, int port) throws Exception
{
assertActiveBundle(bundleContext, "org.eclipse.jetty.osgi.boot");
From 97bba2eb6f80fbf786df8be00329dad5d6d19af3 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Tue, 4 Dec 2018 08:48:15 -0600
Subject: [PATCH 13/35] Issue #3162 - Fail test early if `conscrypt-version` is
undefined (like on Windows, or within an IDE)
Signed-off-by: Joakim Erdfelt
---
.../jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
index e461d6ab975a..f14dedf05dd9 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
@@ -40,6 +40,7 @@
import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
+import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -70,6 +71,7 @@ public class TestJettyOSGiBootHTTP2Conscrypt
public Option[] config()
{
ArrayList options = new ArrayList<>();
+ options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(true,"jetty-http2.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*"));
@@ -99,7 +101,10 @@ public static List http2JettyDependencies()
List res = new ArrayList<>();
res.add(CoreOptions.systemProperty("jetty.alpn.protocols").value("h2,http/1.1"));
res.add(CoreOptions.systemProperty("jetty.sslContext.provider").value("Conscrypt"));
-
+
+ String conscryptVersion = System.getProperty("conscrypt-version");
+ Assume.assumeFalse("Missing 'conscrypt-version' system property", (conscryptVersion == null || conscryptVersion.equals("null")));
+
res.add(wrappedBundle(mavenBundle().groupId("org.conscrypt").artifactId("conscrypt-openjdk-uber").versionAsInProject())
.imports("javax.net.ssl,*")
.exports("org.conscrypt;version="+System.getProperty("conscrypt-version"))
From 7262bfd58485da4b4bdf459d61f2286f49a267dc Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Tue, 4 Dec 2018 08:50:19 -0600
Subject: [PATCH 14/35] Issue #3162 - Fixing testcase assertions
Signed-off-by: Joakim Erdfelt
---
.../osgi/test/TestJettyOSGiBootWithAnnotations.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java
index c8e5a57f1a12..83799c6cb317 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java
@@ -18,9 +18,10 @@
package org.eclipse.jetty.osgi.test;
+import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertThat;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
@@ -118,16 +119,16 @@ public void testIndex() throws Exception
assertEquals(HttpStatus.OK_200, response.getStatus());
String content = response.getContentAsString();
- assertTrue(content.contains("Servlet 3.1 Test WebApp "));
+ assertThat(content, containsString("Servlet 3.0/3.1/4.0 Test WebApp "));
Request req = client.POST("http://127.0.0.1:" + port + "/test");
response = req.send();
content = response.getContentAsString();
- assertTrue(content.contains("Result: PASS
"));
+ assertThat(content, containsString("Result: PASS
"));
response = client.GET("http://127.0.0.1:" + port + "/frag.html");
content = response.getContentAsString();
- assertTrue(content.contains("FRAGMENT "));
+ assertThat(content, containsString("FRAGMENT "));
}
finally
{
From 435dd200bdb205c937da53e9992afa065abc102e Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Tue, 4 Dec 2018 11:31:02 -0600
Subject: [PATCH 15/35] Issue #3162 - Attempting to address ServiceLoader with
javax.websocket (client) on OSGi
Signed-off-by: Joakim Erdfelt
---
.../TestJettyOSGiBootWithJavaxWebSocket.java | 62 ++++++++++---------
.../javax-websocket-client/pom.xml | 13 ++--
.../javax-websocket-server/pom.xml | 1 +
3 files changed, 44 insertions(+), 32 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
index 2f26120da882..696f1d1ed922 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
@@ -48,6 +48,7 @@
import org.osgi.framework.BundleContext;
import aQute.bnd.osgi.Constants;
+import org.osgi.framework.BundleException;
/**
* Test using websocket in osgi
@@ -64,6 +65,7 @@ public class TestJettyOSGiBootWithJavaxWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
+ options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-javax-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
@@ -110,37 +112,16 @@ public void assertAllBundlesActiveOrResolved()
TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext);
TestOSGiUtil.debugBundles(bundleContext);
}
-
-
@Test
public void testWebsocket() throws Exception
{
- //this is necessary because the javax.websocket-api jar does not have manifest headers
- //that allow it to use ServiceLoader in osgi, this corrects that defect
- TinyBundle bundle = TinyBundles.bundle();
- bundle.set(Constants.FRAGMENT_HOST, "javax.websocket-api");
- bundle.set(Constants.REQUIRE_CAPABILITY,
- "osgi.serviceloader;filter:=\"(osgi.serviceloader=javax.websocket.ContainerProvider)\";resolution:=optional;cardinality:=multiple, osgi.extender; filter:=\"(osgi.extender=osgi.serviceloader.processor)\"");
- bundle.set(Constants.BUNDLE_SYMBOLICNAME, "javax.websocket.api.fragment");
- InputStream is = bundle.build(TinyBundles.withBnd());
- bundleContext.installBundle("dummyLocation", is);
-
- Bundle websocketApiBundle = TestOSGiUtil.getBundle(bundleContext, "javax.websocket-api");
- assertNotNull(websocketApiBundle);
- websocketApiBundle.update();
- websocketApiBundle.start();
-
-
- Bundle javaxWebsocketClient = TestOSGiUtil.getBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket");
- assertNotNull(javaxWebsocketClient);
- javaxWebsocketClient.start();
-
- Bundle javaxWebsocketServer = TestOSGiUtil.getBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.server");
- assertNotNull(javaxWebsocketServer);
- javaxWebsocketServer.start();
-
-
+ fixJavaxWebSocketApi();
+
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.common");
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.client");
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.server");
+
String port = System.getProperty("boot.javax.websocket.port");
assertNotNull(port);
@@ -148,7 +129,7 @@ public void testWebsocket() throws Exception
assertNotNull(container);
SimpleJavaxWebSocket socket = new SimpleJavaxWebSocket();
- URI uri = new URI("ws://127.0.0.1:" + port+"/javax.websocket/");
+ URI uri = new URI("ws://127.0.0.1:" + port + "/javax.websocket/");
Session session = container.connectToServer(socket,uri);
try
{
@@ -163,4 +144,29 @@ public void testWebsocket() throws Exception
assertTrue(socket.closeLatch.await(1,TimeUnit.SECONDS)); // give remote 1 second to acknowledge response
}
}
+
+ private void fixJavaxWebSocketApi() throws BundleException
+ {
+ // this is necessary because the javax.websocket-api jar does not have manifest headers
+ // that allow it to use ServiceLoader in osgi, this corrects that defect
+ TinyBundle bundle = TinyBundles.bundle();
+ bundle.set(Constants.FRAGMENT_HOST, "javax.websocket-api");
+ bundle.set(Constants.REQUIRE_CAPABILITY,
+ "osgi.serviceloader;filter:=\"(osgi.serviceloader=javax.websocket.ContainerProvider)\";resolution:=optional;cardinality:=multiple, osgi.extender; filter:=\"(osgi.extender=osgi.serviceloader.processor)\"");
+ bundle.set(Constants.BUNDLE_SYMBOLICNAME, "javax.websocket.api.fragment");
+ InputStream is = bundle.build(TinyBundles.withBnd());
+ bundleContext.installBundle("dummyLocation", is);
+
+ Bundle websocketApiBundle = TestOSGiUtil.getBundle(bundleContext, "javax.websocket-api");
+ assertNotNull(websocketApiBundle);
+ websocketApiBundle.update();
+ websocketApiBundle.start();
+ }
+
+ private void startBundle(BundleContext bundleContext, String symbolicName) throws BundleException
+ {
+ Bundle bundle = TestOSGiUtil.getBundle(bundleContext, symbolicName);
+ assertNotNull("Bundle[" + symbolicName + "] should exist",bundle);
+ bundle.start();
+ }
}
diff --git a/jetty-websocket/javax-websocket-client/pom.xml b/jetty-websocket/javax-websocket-client/pom.xml
index 947279805780..0b3c8ec87974 100644
--- a/jetty-websocket/javax-websocket-client/pom.xml
+++ b/jetty-websocket/javax-websocket-client/pom.xml
@@ -13,7 +13,7 @@
Jetty :: Websocket :: javax.websocket :: Client Implementation
- ${project.groupId}.javax.websocket
+ ${project.groupId}.javax.websocket.client
@@ -53,10 +53,15 @@
javax.websocket.client Implementation
- org.eclipse.jetty.websocket.jsr356.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
+ org.eclipse.jetty.websocket.jsr356.client.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
- osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
- osgi.serviceloader;osgi.serviceloader=javax.websocket.ContainerProvider
+
+ osgi.extender;
+ filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
+
+
+ osgi.serviceloader;osgi.serviceloader=javax.websocket.ContainerProvider
+
diff --git a/jetty-websocket/javax-websocket-server/pom.xml b/jetty-websocket/javax-websocket-server/pom.xml
index 0a9f061815cf..48fe7f1b80a5 100644
--- a/jetty-websocket/javax-websocket-server/pom.xml
+++ b/jetty-websocket/javax-websocket-server/pom.xml
@@ -74,6 +74,7 @@
filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional
+ osgi.serviceloader;osgi.serviceloader=org.eclipse.jetty.webapp.Configuration,
osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer,
osgi.serviceloader;osgi.serviceloader=javax.websocket.server.ServerEndpointConfig$Configurator
From 1167adf7132a0596d665df2f7b4db17ee8c78808 Mon Sep 17 00:00:00 2001
From: Jan Bartel
Date: Wed, 12 Dec 2018 10:15:43 +1100
Subject: [PATCH 16/35] Issue #3162 Partial fix for javaxwebsocket in osgi,
wip.
---
.../test/TestJettyOSGiBootWithJavaxWebSocket.java | 12 +++++++++---
.../org/eclipse/jetty/osgi/test/TestOSGiUtil.java | 9 +++++----
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
index 696f1d1ed922..90a4f260fefc 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
@@ -91,7 +91,8 @@ public static List jspDependencies()
public static List annotationDependencies()
{
List res = new ArrayList<>();
- res.add(mavenBundle().groupId( "org.eclipse.jetty.orbit" ).artifactId( "javax.mail.glassfish" ).version( "1.4.1.v201005082020" ).noStart());
+ res.add(mavenBundle().groupId("com.sun.activation").artifactId("javax.activation").version("1.2.0").noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.mail.glassfish").version("1.4.1.v201005082020").noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty.tests").artifactId("test-mock-resources").versionAsInProject());
//test webapp bundle
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("test-jetty-webapp").classifier("webbundle").versionAsInProject());
@@ -105,10 +106,15 @@ public static List extraDependencies()
return res;
}
-
@Ignore
- public void assertAllBundlesActiveOrResolved()
+ public void assertAllBundlesActiveOrResolved() throws BundleException
{
+ fixJavaxWebSocketApi();
+
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.common");
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.client");
+ startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.server");
+
TestOSGiUtil.assertAllBundlesActiveOrResolved(bundleContext);
TestOSGiUtil.debugBundles(bundleContext);
}
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 37f5fc5e0f80..d12872dc329d 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -139,10 +139,11 @@ public static List coreJettyDependencies()
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-servlet" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-server" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-client" ).versionAsInProject().start());
- res.add(mavenBundle().groupId( "javax.websocket" ).artifactId( "javax.websocket-api" ).versionAsInProject().start());
- res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "javax-websocket-common").versionAsInProject().start());
- res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "javax-websocket-client-impl").versionAsInProject().start());
- res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "javax-websocket-server-impl").versionAsInProject().start());
+
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-common").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-client-impl").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-server-impl").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("javax.websocket").artifactId("javax.websocket-api").versionAsInProject().noStart());
res.add(mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject().start());
return res;
}
From 755d5728d938d2111c087437eff48dd8700bce93 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Wed, 30 Jan 2019 12:43:21 -0600
Subject: [PATCH 17/35] Issue #3162 - Using snapshot repositories on CI
(temporary)
Signed-off-by: Joakim Erdfelt
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index ff2537e5f33d..67c2dc4d8912 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -10,7 +10,7 @@ pipeline {
agent { node { label 'linux' } }
options { timeout(time: 120, unit: 'MINUTES') }
steps {
- mavenBuild("jdk11", "-Pautobahn -Pmongodb install", "maven3")
+ mavenBuild("jdk11", "-Pautobahn -Pmongodb -Psnapshot-repositories install", "maven3")
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'Java']]
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
@@ -44,7 +44,7 @@ pipeline {
agent { node { label 'linux' } }
options { timeout(time: 30, unit: 'MINUTES') }
steps {
- mavenBuild("jdk11", "install javadoc:javadoc -DskipTests", "maven3")
+ mavenBuild("jdk11", "-Psnapshot-repositories install javadoc:javadoc -DskipTests", "maven3")
warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']]
}
}
From 26fa79a0500d2f8ded1714b2bf3092ad883cc9c6 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Wed, 30 Jan 2019 12:43:36 -0600
Subject: [PATCH 18/35] Issue #3162 - Reverting not-relevant OSGi changes
Signed-off-by: Joakim Erdfelt
---
.../annotations/AnnotationConfiguration.java | 2 --
.../jetty/osgi/boot/BundleContextProvider.java | 2 +-
.../jetty/osgi/boot/BundleWebAppProvider.java | 2 +-
.../osgi/boot/ServiceContextProvider.java | 2 +-
.../jetty/osgi/boot/ServiceWebAppProvider.java | 2 +-
.../org.eclipse.jetty.webapp.Configuration | 1 -
.../src/test/config/etc/jetty-deployer.xml | 2 --
.../jetty/osgi/test/SimpleEchoSocket.java | 18 ++++++++++--------
.../test/TestJettyOSGiBootHTTP2Conscrypt.java | 1 -
.../TestJettyOSGiBootWithJavaxWebSocket.java | 2 +-
.../test/TestJettyOSGiBootWithWebSocket.java | 1 -
11 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
index 456245bb18a2..fddb0e8cc0d3 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
@@ -74,8 +74,6 @@ public Void call() throws Exception
public AnnotationConfiguration()
{
- super();
- protectAndExpose("org.eclipse.jetty.osgi.annotations.");
}
/**
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
index ed82f560aeec..e88526a0d86e 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java
@@ -44,7 +44,7 @@
*/
public class BundleContextProvider extends AbstractContextProvider implements BundleProvider
{
- private static final Logger LOG = Log.getLogger(BundleContextProvider.class);
+ private static final Logger LOG = Log.getLogger(AbstractContextProvider.class);
private Map _appMap = new HashMap();
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
index f1fff9c45c55..a3768471d2b4 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java
@@ -43,7 +43,7 @@
*/
public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider
{
- private static final Logger LOG = Log.getLogger(BundleWebAppProvider.class);
+ private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class);
/**
* Map of Bundle to App. Used when a Bundle contains a webapp.
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
index bb2246d53cad..783a3e98fe91 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java
@@ -49,7 +49,7 @@
*/
public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider
{
- private static final Logger LOG = Log.getLogger(ServiceContextProvider.class);
+ private static final Logger LOG = Log.getLogger(AbstractContextProvider.class);
private Map _serviceMap = new HashMap<>();
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
index 6c7f8957229c..4ffa01779054 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java
@@ -47,7 +47,7 @@
*/
public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider
{
- private static final Logger LOG = Log.getLogger(ServiceWebAppProvider.class);
+ private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class);
/**
* Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext.
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
index 7bda8437fdf0..f67098630268 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
+++ b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
@@ -1,3 +1,2 @@
org.eclipse.jetty.osgi.annotations.AnnotationConfiguration
org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration
-org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
index f3acb5ecf6e0..19b3a5db090b 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml
@@ -12,12 +12,10 @@
-
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
index beeaec682f55..0629ca8600da 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
@@ -19,10 +19,9 @@
package org.eclipse.jetty.osgi.test;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
@@ -36,7 +35,6 @@
@WebSocket(maxTextMessageSize = 64 * 1024)
public class SimpleEchoSocket
{
- private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
private final CountDownLatch closeLatch;
@SuppressWarnings("unused")
private Session session;
@@ -54,8 +52,7 @@ public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedExcepti
@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
- LOG.debug("Connection closed: {} - {}", statusCode, reason);
-
+ //System.out.printf("Connection closed: %d - %s%n",statusCode,reason);
this.session = null;
this.closeLatch.countDown(); // trigger latch
}
@@ -63,11 +60,16 @@ public void onClose(int statusCode, String reason)
@OnWebSocketConnect
public void onConnect(Session session)
{
- LOG.debug("Got connect: {}", session);
+ //System.out.printf("Got connect: %s%n",session);
this.session = session;
try
{
- session.getRemote().sendString("Foo");
+ Future fut;
+ //System.err.println("Sending Foo!");
+ fut = session.getRemote().sendStringByFuture("Foo");
+
+ fut.get(2,TimeUnit.SECONDS); // wait for send to complete.
+ //System.err.println("Foo complete");
session.close(StatusCode.NORMAL,"I'm done");
}
@@ -80,6 +82,6 @@ public void onConnect(Session session)
@OnWebSocketMessage
public void onMessage(String msg)
{
- LOG.debug("Got msg: {}", msg);
+ //System.out.printf("Got msg: %s%n",msg);
}
}
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
index f7bd451ab54a..6049796b7611 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
@@ -69,7 +69,6 @@ public class TestJettyOSGiBootHTTP2Conscrypt
public Option[] config()
{
ArrayList options = new ArrayList<>();
- options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(true,"jetty-http2.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*"));
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
index a7f7573e7320..2155ab2c42a0 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
@@ -64,7 +64,7 @@ public class TestJettyOSGiBootWithJavaxWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
- options.add(TestOSGiUtil.optionalRemoteDebug());
+ // options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-javax-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
index bec6e8e326ed..1f37b0b9a54d 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
@@ -55,7 +55,6 @@ public class TestJettyOSGiBootWithWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
- options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
From c25cbf3480375954e4666c5852c1c814caac5da0 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Wed, 30 Jan 2019 12:47:25 -0600
Subject: [PATCH 19/35] Issue #3162 - Reverting not-relevant JspConfig change.
Signed-off-by: Joakim Erdfelt
---
apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
index 7e0ce3ad8ed1..773588a977e0 100644
--- a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
+++ b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
@@ -33,7 +33,7 @@ public static void init(WebAppContext context, URI baseUri, File scratchDir)
{
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
+ ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
context.setWar(baseUri.toASCIIString());
context.setResourceBase(baseUri.toASCIIString());
}
From 3c9c78c8356694ba0ae367b909baa876b8058694 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 17 Jan 2019 10:43:03 +0100
Subject: [PATCH 20/35] Issue #132 - ClientConnector abstraction.
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.
Refactored also HTTP2Client to reference ClientConnector.
Refactored tests accordingly to the changes introduced in the
implementations.
Signed-off-by: Simone Bordet
---
.../alpn/client/ALPNClientConnection.java | 8 +-
.../client/ALPNClientConnectionFactory.java | 3 +-
jetty-alpn/jetty-alpn-java-client/pom.xml | 1 +
.../alpn/java/client/JDK9HTTP2Client.java | 5 +-
.../jetty/alpn/java/server/JDK9ALPNTest.java | 21 +-
.../AbstractConnectorHttpClientTransport.java | 156 ++------
.../client/AbstractHttpClientTransport.java | 13 +
.../org/eclipse/jetty/client/HttpClient.java | 91 ++---
.../jetty/client/HttpClientTransport.java | 4 +-
.../java/org/eclipse/jetty/client/Origin.java | 40 ++-
.../jetty/client/ResponseNotifier.java | 27 +-
.../http/HttpClientTransportOverHTTP.java | 11 +-
.../client/http/HttpConnectionOverHTTP.java | 1 -
.../client/HttpClientCustomProxyTest.java | 7 +-
.../eclipse/jetty/client/HttpClientTest.java | 28 +-
.../InsufficientThreadsDetectionTest.java | 12 +-
.../http/HttpDestinationOverHTTPTest.java | 18 +-
.../http/HttpClientTransportOverFCGI.java | 9 +-
.../jetty/http2/client/HTTP2Client.java | 245 +++----------
.../client/HTTP2ClientConnectionFactory.java | 15 +-
.../eclipse/jetty/http2/client/Client.java | 94 -----
.../http/HttpClientTransportOverHTTP2.java | 19 +-
.../client/http/MaxConcurrentStreamsTest.java | 6 +-
.../jetty/io/ClientConnectionFactory.java | 8 +-
.../org/eclipse/jetty/io/ClientConnector.java | 333 ++++++++++++++++++
.../jetty/io/NegotiatingClientConnection.java | 6 +-
.../io/ssl/SslClientConnectionFactory.java | 17 +-
.../eclipse/jetty/proxy/ProxyServletTest.java | 18 +-
.../HttpClientTransportOverUnixSockets.java | 144 +++++---
.../jetty/unixsocket/UnixSocketTest.java | 97 +++--
.../http/client/ConnectionStatisticsTest.java | 21 +-
.../http/client/HttpClientContinueTest.java | 10 +-
.../client/HttpClientIdleTimeoutTest.java | 18 +-
.../jetty/http/client/HttpClientTest.java | 25 +-
.../test/resources/jetty-logging.properties | 2 +-
35 files changed, 781 insertions(+), 752 deletions(-)
delete mode 100644 jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java
create mode 100644 jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
diff --git a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java
index 9779f0ec49ab..4b6c25573b88 100644
--- a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java
+++ b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java
@@ -27,13 +27,9 @@
import org.eclipse.jetty.io.ClientConnectionFactory;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.NegotiatingClientConnection;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
public class ALPNClientConnection extends NegotiatingClientConnection
{
- private static final Logger LOG = Log.getLogger(ALPNClientConnection.class);
-
private final List protocols;
public ALPNClientConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, SSLEngine sslEngine, Map context, List protocols)
@@ -49,9 +45,9 @@ public List getProtocols()
public void selected(String protocol)
{
- if (protocol==null || !protocols.contains(protocol))
+ if (protocol == null || !protocols.contains(protocol))
close();
else
- super.completed();
+ completed();
}
}
diff --git a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java
index c1a003266206..75d14ff337ce 100644
--- a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java
+++ b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java
@@ -18,7 +18,6 @@
package org.eclipse.jetty.alpn.client;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -96,7 +95,7 @@ public ALPNClientConnectionFactory(Executor executor, ClientConnectionFactory co
}
@Override
- public Connection newConnection(EndPoint endPoint, Map context) throws IOException
+ public Connection newConnection(EndPoint endPoint, Map context)
{
SSLEngine engine = (SSLEngine)context.get(SslClientConnectionFactory.SSL_ENGINE_CONTEXT_KEY);
for (Client processor : processors)
diff --git a/jetty-alpn/jetty-alpn-java-client/pom.xml b/jetty-alpn/jetty-alpn-java-client/pom.xml
index 31660c91677f..6054bc0d7a6b 100644
--- a/jetty-alpn/jetty-alpn-java-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-java-client/pom.xml
@@ -42,6 +42,7 @@
jetty-alpn-client
${project.version}
+
org.eclipse.jetty.http2
http2-client
diff --git a/jetty-alpn/jetty-alpn-java-client/src/test/java/org/eclipse/jetty/alpn/java/client/JDK9HTTP2Client.java b/jetty-alpn/jetty-alpn-java-client/src/test/java/org/eclipse/jetty/alpn/java/client/JDK9HTTP2Client.java
index 9dbcf11e479c..aa772b826e36 100644
--- a/jetty-alpn/jetty-alpn-java-client/src/test/java/org/eclipse/jetty/alpn/java/client/JDK9HTTP2Client.java
+++ b/jetty-alpn/jetty-alpn-java-client/src/test/java/org/eclipse/jetty/alpn/java/client/JDK9HTTP2Client.java
@@ -35,22 +35,19 @@
import org.eclipse.jetty.util.FuturePromise;
import org.eclipse.jetty.util.Jetty;
import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
public class JDK9HTTP2Client
{
public static void main(String[] args) throws Exception
{
HTTP2Client client = new HTTP2Client();
- SslContextFactory sslContextFactory = new SslContextFactory();
- client.addBean(sslContextFactory);
client.start();
String host = "webtide.com";
int port = 443;
FuturePromise sessionPromise = new FuturePromise<>();
- client.connect(sslContextFactory, new InetSocketAddress(host, port), new Session.Listener.Adapter(), sessionPromise);
+ client.connect(client.getClientConnector().getSslContextFactory(), new InetSocketAddress(host, port), new Session.Listener.Adapter(), sessionPromise);
Session session = sessionPromise.get(5, TimeUnit.SECONDS);
HttpFields requestFields = new HttpFields();
diff --git a/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java b/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
index 8f74502dfe31..72a5aef503ac 100644
--- a/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
+++ b/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
@@ -18,11 +18,7 @@
package org.eclipse.jetty.alpn.java.server;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@@ -31,7 +27,6 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -45,8 +40,12 @@
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+
public class JDK9ALPNTest
{
private Server server;
@@ -66,6 +65,13 @@ public void startServer(Handler handler) throws Exception
server.start();
}
+ @AfterEach
+ public void stopServer() throws Exception
+ {
+ if (server != null)
+ server.stop();
+ }
+
private SslContextFactory newSslContextFactory()
{
SslContextFactory sslContextFactory = new SslContextFactory();
@@ -84,7 +90,7 @@ public void testClientNotSupportingALPNServerSpeaksDefaultProtocol() throws Exce
startServer(new AbstractHandler.ErrorDispatchHandler()
{
@Override
- protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
{
baseRequest.setHandled(true);
}
@@ -126,7 +132,7 @@ public void testClientSupportingALPNServerSpeaksNegotiatedProtocol() throws Exce
startServer(new AbstractHandler.ErrorDispatchHandler()
{
@Override
- protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
{
baseRequest.setHandled(true);
}
@@ -163,6 +169,5 @@ protected void doNonErrorHandle(String target, Request baseRequest, HttpServletR
break;
}
}
-
}
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
index 67f57a114863..0c234daa160f 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
@@ -18,21 +18,12 @@
package org.eclipse.jetty.client;
-import java.io.IOException;
import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
+import java.time.Duration;
import java.util.Map;
import org.eclipse.jetty.client.api.Connection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.ManagedSelector;
-import org.eclipse.jetty.io.SelectorManager;
-import org.eclipse.jetty.io.SocketChannelEndPoint;
-import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
@@ -40,147 +31,48 @@
@ManagedObject
public abstract class AbstractConnectorHttpClientTransport extends AbstractHttpClientTransport
{
- private final int selectors;
- private SelectorManager selectorManager;
+ private final ClientConnector connector;
- protected AbstractConnectorHttpClientTransport(int selectors)
+ protected AbstractConnectorHttpClientTransport(ClientConnector connector)
{
- this.selectors = selectors;
+ this.connector = connector;
+ addBean(connector);
+ }
+
+ public ClientConnector getClientConnector()
+ {
+ return connector;
}
@ManagedAttribute(value = "The number of selectors", readonly = true)
public int getSelectors()
{
- return selectors;
+ return connector.getSelectors();
}
@Override
protected void doStart() throws Exception
{
HttpClient httpClient = getHttpClient();
- selectorManager = newSelectorManager(httpClient);
- selectorManager.setConnectTimeout(httpClient.getConnectTimeout());
- addBean(selectorManager);
+ connector.setBindAddress(httpClient.getBindAddress());
+ connector.setByteBufferPool(httpClient.getByteBufferPool());
+ connector.setConnectBlocking(httpClient.isConnectBlocking());
+ connector.setConnectTimeout(Duration.ofMillis(httpClient.getConnectTimeout()));
+ connector.setExecutor(httpClient.getExecutor());
+ connector.setIdleTimeout(Duration.ofMillis(httpClient.getIdleTimeout()));
+ connector.setScheduler(httpClient.getScheduler());
+ connector.setSslContextFactory(httpClient.getSslContextFactory());
super.doStart();
}
- @Override
- protected void doStop() throws Exception
- {
- super.doStop();
- removeBean(selectorManager);
- }
-
@Override
public void connect(InetSocketAddress address, Map context)
{
- SocketChannel channel = null;
- try
- {
- channel = SocketChannel.open();
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- HttpClient client = destination.getHttpClient();
- SocketAddress bindAddress = client.getBindAddress();
- if (bindAddress != null)
- channel.bind(bindAddress);
- configure(client, channel);
-
- context.put(SslClientConnectionFactory.SSL_PEER_HOST_CONTEXT_KEY, destination.getHost());
- context.put(SslClientConnectionFactory.SSL_PEER_PORT_CONTEXT_KEY, destination.getPort());
-
- boolean connected = true;
- if (client.isConnectBlocking())
- {
- channel.socket().connect(address, (int)client.getConnectTimeout());
- channel.configureBlocking(false);
- }
- else
- {
- channel.configureBlocking(false);
- connected = channel.connect(address);
- }
- if (connected)
- selectorManager.accept(channel, context);
- else
- selectorManager.connect(channel, context);
- }
- // Must catch all exceptions, since some like
- // UnresolvedAddressException are not IOExceptions.
- catch (Throwable x)
- {
- // If IPv6 is not deployed, a generic SocketException "Network is unreachable"
- // exception is being thrown, so we attempt to provide a better error message.
- if (x.getClass() == SocketException.class)
- x = new SocketException("Could not connect to " + address).initCause(x);
-
- try
- {
- if (channel != null)
- channel.close();
- }
- catch (IOException xx)
- {
- LOG.ignore(xx);
- }
- finally
- {
- connectFailed(context, x);
- }
- }
- }
-
- protected void connectFailed(Map context, Throwable x)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Could not connect to {}", context.get(HTTP_DESTINATION_CONTEXT_KEY));
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ context.put(ClientConnector.CLIENT_CONNECTION_FACTORY_CONTEXT_KEY, destination.getClientConnectionFactory());
@SuppressWarnings("unchecked")
Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
- promise.failed(x);
- }
-
- protected void configure(HttpClient client, SocketChannel channel) throws IOException
- {
- channel.socket().setTcpNoDelay(client.isTCPNoDelay());
- }
-
- protected SelectorManager newSelectorManager(HttpClient client)
- {
- return new ClientSelectorManager(client, getSelectors());
- }
-
- protected class ClientSelectorManager extends SelectorManager
- {
- private final HttpClient client;
-
- protected ClientSelectorManager(HttpClient client, int selectors)
- {
- super(client.getExecutor(), client.getScheduler(), selectors);
- this.client = client;
- }
-
- @Override
- protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key)
- {
- SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, key, getScheduler());
- endp.setIdleTimeout(client.getIdleTimeout());
- return endp;
- }
-
- @Override
- public org.eclipse.jetty.io.Connection newConnection(SelectableChannel channel, EndPoint endPoint, Object attachment) throws IOException
- {
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- return destination.getClientConnectionFactory().newConnection(endPoint, context);
- }
-
- @Override
- protected void connectionFailed(SelectableChannel channel, Throwable x, Object attachment)
- {
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- connectFailed(context, x);
- }
+ context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise));
+ connector.connect(address, context);
}
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java
index 3a601f7c2378..e5282e0fce9d 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java
@@ -18,6 +18,10 @@
package org.eclipse.jetty.client;
+import java.util.Map;
+
+import org.eclipse.jetty.client.api.Connection;
+import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.log.Log;
@@ -53,4 +57,13 @@ public void setConnectionPoolFactory(ConnectionPool.Factory factory)
{
this.factory = factory;
}
+
+ protected void connectFailed(Map context, Throwable failure)
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Could not connect to {}", context.get(HTTP_DESTINATION_CONTEXT_KEY));
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ promise.failed(failure);
+ }
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
index e6761f41eca1..555871270cc9 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
@@ -81,16 +81,16 @@
import org.eclipse.jetty.util.thread.ThreadPool;
/**
- * {@link HttpClient} provides an efficient, asynchronous, non-blocking implementation
+ *
HttpClient provides an efficient, asynchronous, non-blocking implementation
* to perform HTTP requests to a server through a simple API that offers also blocking semantic.
- * {@link HttpClient} provides easy-to-use methods such as {@link #GET(String)} that allow to perform HTTP
+ *
HttpClient provides easy-to-use methods such as {@link #GET(String)} that allow to perform HTTP
* requests in a one-liner, but also gives the ability to fine tune the configuration of requests via
* {@link HttpClient#newRequest(URI)}.
- * {@link HttpClient} acts as a central configuration point for network parameters (such as idle timeouts)
+ *
HttpClient acts as a central configuration point for network parameters (such as idle timeouts)
* and HTTP parameters (such as whether to follow redirects).
- * {@link HttpClient} transparently pools connections to servers, but allows direct control of connections
+ *
HttpClient transparently pools connections to servers, but allows direct control of connections
* for cases where this is needed.
- * {@link HttpClient} also acts as a central configuration point for cookies, via {@link #getCookieStore()}.
+ * HttpClient also acts as a central configuration point for cookies, via {@link #getCookieStore()}.
* Typical usage:
*
* HttpClient httpClient = new HttpClient();
@@ -157,7 +157,7 @@ public class HttpClient extends ContainerLifeCycle
private String defaultRequestContentType = "application/octet-stream";
/**
- * Creates a {@link HttpClient} instance that can perform requests to non-TLS destinations only
+ * Creates a HttpClient instance that can perform requests to non-TLS destinations only
* (that is, requests with the "http" scheme only, and not "https").
*
* @see #HttpClient(SslContextFactory) to perform requests to TLS destinations.
@@ -168,7 +168,7 @@ public HttpClient()
}
/**
- * Creates a {@link HttpClient} instance that can perform requests to non-TLS and TLS destinations
+ * Creates a HttpClient instance that can perform requests to non-TLS and TLS destinations
* (that is, both requests with the "http" scheme and with the "https" scheme).
*
* @param sslContextFactory the {@link SslContextFactory} that manages TLS encryption
@@ -517,7 +517,7 @@ private URI checkHost(URI uri)
/**
* Returns a {@link Destination} for the given scheme, host and port.
* Applications may use {@link Destination}s to create {@link Connection}s
- * that will be outside {@link HttpClient}'s pooling mechanism, to explicitly
+ * that will be outside HttpClient's pooling mechanism, to explicitly
* control the connection lifecycle (in particular their termination with
* {@link Connection#close()}).
*
@@ -570,7 +570,7 @@ protected boolean removeDestination(HttpDestination destination)
}
/**
- * @return the list of destinations known to this {@link HttpClient}.
+ * @return the list of destinations known to this HttpClient.
*/
public List getDestinations()
{
@@ -586,13 +586,13 @@ protected void send(final HttpRequest request, List l
protected void newConnection(final HttpDestination destination, final Promise promise)
{
Origin.Address address = destination.getConnectAddress();
- resolver.resolve(address.getHost(), address.getPort(), new Promise>()
+ resolver.resolve(address.getHost(), address.getPort(), new Promise<>()
{
@Override
public void succeeded(List socketAddresses)
{
Map context = new HashMap<>();
- context.put(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY, HttpClient.this);
+ context.put(ClientConnectionFactory.CLIENT_CONTEXT_KEY, HttpClient.this);
context.put(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY, destination);
connect(socketAddresses, 0, context);
}
@@ -605,7 +605,7 @@ public void failed(Throwable x)
private void connect(List socketAddresses, int index, Map context)
{
- context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper(promise)
+ context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise)
{
@Override
public void failed(Throwable x)
@@ -638,7 +638,7 @@ protected ProtocolHandler findProtocolHandler(Request request, Response response
}
/**
- * @return the {@link ByteBufferPool} of this {@link HttpClient}
+ * @return the {@link ByteBufferPool} of this HttpClient
*/
public ByteBufferPool getByteBufferPool()
{
@@ -646,7 +646,7 @@ public ByteBufferPool getByteBufferPool()
}
/**
- * @param byteBufferPool the {@link ByteBufferPool} of this {@link HttpClient}
+ * @param byteBufferPool the {@link ByteBufferPool} of this HttpClient
*/
public void setByteBufferPool(ByteBufferPool byteBufferPool)
{
@@ -706,7 +706,7 @@ public long getAddressResolutionTimeout()
/**
* Sets the socket address resolution timeout used by the default {@link SocketAddressResolver}
- * created by this {@link HttpClient} at startup.
+ * created by this HttpClient at startup.
* For more fine tuned configuration of socket address resolution, see
* {@link #setSocketAddressResolver(SocketAddressResolver)}.
*
@@ -755,7 +755,7 @@ public void setBindAddress(SocketAddress bindAddress)
}
/**
- * @return the "User-Agent" HTTP field of this {@link HttpClient}
+ * @return the "User-Agent" HTTP field of this HttpClient
*/
public HttpField getUserAgentField()
{
@@ -763,7 +763,7 @@ public HttpField getUserAgentField()
}
/**
- * @param agent the "User-Agent" HTTP header string of this {@link HttpClient}
+ * @param agent the "User-Agent" HTTP header string of this HttpClient
*/
public void setUserAgentField(HttpField agent)
{
@@ -773,7 +773,7 @@ public void setUserAgentField(HttpField agent)
}
/**
- * @return whether this {@link HttpClient} follows HTTP redirects
+ * @return whether this HttpClient follows HTTP redirects
* @see Request#isFollowRedirects()
*/
@ManagedAttribute("Whether HTTP redirects are followed")
@@ -783,7 +783,7 @@ public boolean isFollowRedirects()
}
/**
- * @param follow whether this {@link HttpClient} follows HTTP redirects
+ * @param follow whether this HttpClient follows HTTP redirects
* @see #setMaxRedirects(int)
*/
public void setFollowRedirects(boolean follow)
@@ -792,7 +792,7 @@ public void setFollowRedirects(boolean follow)
}
/**
- * @return the {@link Executor} of this {@link HttpClient}
+ * @return the {@link Executor} of this HttpClient
*/
public Executor getExecutor()
{
@@ -800,7 +800,7 @@ public Executor getExecutor()
}
/**
- * @param executor the {@link Executor} of this {@link HttpClient}
+ * @param executor the {@link Executor} of this HttpClient
*/
public void setExecutor(Executor executor)
{
@@ -811,7 +811,7 @@ public void setExecutor(Executor executor)
}
/**
- * @return the {@link Scheduler} of this {@link HttpClient}
+ * @return the {@link Scheduler} of this HttpClient
*/
public Scheduler getScheduler()
{
@@ -819,7 +819,7 @@ public Scheduler getScheduler()
}
/**
- * @param scheduler the {@link Scheduler} of this {@link HttpClient}
+ * @param scheduler the {@link Scheduler} of this HttpClient
*/
public void setScheduler(Scheduler scheduler)
{
@@ -830,7 +830,7 @@ public void setScheduler(Scheduler scheduler)
}
/**
- * @return the {@link SocketAddressResolver} of this {@link HttpClient}
+ * @return the {@link SocketAddressResolver} of this HttpClient
*/
public SocketAddressResolver getSocketAddressResolver()
{
@@ -838,7 +838,7 @@ public SocketAddressResolver getSocketAddressResolver()
}
/**
- * @param resolver the {@link SocketAddressResolver} of this {@link HttpClient}
+ * @param resolver the {@link SocketAddressResolver} of this HttpClient
*/
public void setSocketAddressResolver(SocketAddressResolver resolver)
{
@@ -849,7 +849,7 @@ public void setSocketAddressResolver(SocketAddressResolver resolver)
}
/**
- * @return the max number of connections that this {@link HttpClient} opens to {@link Destination}s
+ * @return the max number of connections that this HttpClient opens to {@link Destination}s
*/
@ManagedAttribute("The max number of connections per each destination")
public int getMaxConnectionsPerDestination()
@@ -862,11 +862,11 @@ public int getMaxConnectionsPerDestination()
*
* RFC 2616 suggests that 2 connections should be opened per each destination,
* but browsers commonly open 6.
- * If this {@link HttpClient} is used for load testing, it is common to have only one destination
+ * If this HttpClient is used for load testing, it is common to have only one destination
* (the server to load test), and it is recommended to set this value to a high value (at least as
* much as the threads present in the {@link #getExecutor() executor}).
*
- * @param maxConnectionsPerDestination the max number of connections that this {@link HttpClient} opens to {@link Destination}s
+ * @param maxConnectionsPerDestination the max number of connections that this HttpClient opens to {@link Destination}s
*/
public void setMaxConnectionsPerDestination(int maxConnectionsPerDestination)
{
@@ -885,11 +885,11 @@ public int getMaxRequestsQueuedPerDestination()
/**
* Sets the max number of requests that may be queued to a destination.
*
- * If this {@link HttpClient} performs a high rate of requests to a destination,
+ * If this HttpClient performs a high rate of requests to a destination,
* and all the connections managed by that destination are busy with other requests,
* then new requests will be queued up in the destination.
* This parameter controls how many requests can be queued before starting to reject them.
- * If this {@link HttpClient} is used for load testing, it is common to have this parameter
+ * If this HttpClient is used for load testing, it is common to have this parameter
* set to a high value, although this may impact latency (requests sit in the queue for a long
* time before being sent).
*
@@ -970,35 +970,6 @@ public void setTCPNoDelay(boolean tcpNoDelay)
this.tcpNoDelay = tcpNoDelay;
}
- /**
- * @return true to dispatch I/O operations in a different thread, false to execute them in the selector thread
- * @see #setDispatchIO(boolean)
- */
- @Deprecated
- public boolean isDispatchIO()
- {
- // TODO this did default to true, so usage needs to be evaluated.
- return false;
- }
-
- /**
- * Whether to dispatch I/O operations from the selector thread to a different thread.
- *
- * This implementation never blocks on I/O operation, but invokes application callbacks that may
- * take time to execute or block on other I/O.
- * If application callbacks are known to take time or block on I/O, then parameter {@code dispatchIO}
- * should be set to true.
- * If application callbacks are known to be quick and never block on I/O, then parameter {@code dispatchIO}
- * may be set to false.
- *
- * @param dispatchIO true to dispatch I/O operations in a different thread,
- * false to execute them in the selector thread
- */
- @Deprecated
- public void setDispatchIO(boolean dispatchIO)
- {
- }
-
/**
* Gets the http compliance mode for parsing http responses.
* The default http compliance level is {@link HttpCompliance#RFC7230} which is the latest HTTP/1.1 specification
@@ -1256,7 +1227,7 @@ public boolean containsAll(Collection> c)
public Iterator iterator()
{
final Iterator iterator = set.iterator();
- return new Iterator()
+ return new Iterator<>()
{
@Override
public boolean hasNext()
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClientTransport.java
index ff5f9269d6d6..7d2366a19fd0 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClientTransport.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClientTransport.java
@@ -36,8 +36,8 @@
*/
public interface HttpClientTransport extends ClientConnectionFactory
{
- public static final String HTTP_DESTINATION_CONTEXT_KEY = "http.destination";
- public static final String HTTP_CONNECTION_PROMISE_CONTEXT_KEY = "http.connection.promise";
+ public static final String HTTP_DESTINATION_CONTEXT_KEY = "org.eclipse.jetty.client.destination";
+ public static final String HTTP_CONNECTION_PROMISE_CONTEXT_KEY = "org.eclipse.jetty.client.connection.promise";
/**
* Sets the {@link HttpClient} instance on this transport.
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java b/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java
index c94dfb8928cd..344b1c16edb5 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java
@@ -48,18 +48,13 @@ public Address getAddress()
return address;
}
- public String asString()
- {
- StringBuilder result = new StringBuilder();
- URIUtil.appendSchemeHostPort(result, scheme, address.host, address.port);
- return result.toString();
- }
-
@Override
public boolean equals(Object obj)
{
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
Origin that = (Origin)obj;
return scheme.equals(that.scheme) && address.equals(that.address);
}
@@ -67,9 +62,20 @@ public boolean equals(Object obj)
@Override
public int hashCode()
{
- int result = scheme.hashCode();
- result = 31 * result + address.hashCode();
- return result;
+ return Objects.hash(scheme, address);
+ }
+
+ public String asString()
+ {
+ StringBuilder result = new StringBuilder();
+ URIUtil.appendSchemeHostPort(result, scheme, address.host, address.port);
+ return result.toString();
+ }
+
+ @Override
+ public String toString()
+ {
+ return asString();
}
public static class Address
@@ -96,8 +102,10 @@ public int getPort()
@Override
public boolean equals(Object obj)
{
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
Address that = (Address)obj;
return host.equals(that.host) && port == that.port;
}
@@ -105,9 +113,7 @@ public boolean equals(Object obj)
@Override
public int hashCode()
{
- int result = host.hashCode();
- result = 31 * result + port;
- return result;
+ return Objects.hash(host, port);
}
public String asString()
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java b/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java
index 6d9faa94089a..7db9af838515 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java
@@ -203,16 +203,7 @@ private void notifyComplete(Response.CompleteListener listener, Result result)
public void forwardSuccess(List listeners, Response response)
{
- notifyBegin(listeners, response);
- for (Iterator iterator = response.getHeaders().iterator(); iterator.hasNext();)
- {
- HttpField field = iterator.next();
- if (!notifyHeader(listeners, response, field))
- iterator.remove();
- }
- notifyHeaders(listeners, response);
- if (response instanceof ContentResponse)
- notifyContent(listeners, response, ByteBuffer.wrap(((ContentResponse)response).getContent()), Callback.NOOP);
+ forwardEvents(listeners, response);
notifySuccess(listeners, response);
}
@@ -223,9 +214,16 @@ public void forwardSuccessComplete(List listeners, Re
}
public void forwardFailure(List listeners, Response response, Throwable failure)
+ {
+ forwardEvents(listeners, response);
+ notifyFailure(listeners, response, failure);
+ }
+
+ private void forwardEvents(List listeners, Response response)
{
notifyBegin(listeners, response);
- for (Iterator iterator = response.getHeaders().iterator(); iterator.hasNext();)
+ Iterator iterator = response.getHeaders().iterator();
+ while (iterator.hasNext())
{
HttpField field = iterator.next();
if (!notifyHeader(listeners, response, field))
@@ -233,8 +231,11 @@ public void forwardFailure(List listeners, Response r
}
notifyHeaders(listeners, response);
if (response instanceof ContentResponse)
- notifyContent(listeners, response, ByteBuffer.wrap(((ContentResponse)response).getContent()), Callback.NOOP);
- notifyFailure(listeners, response, failure);
+ {
+ byte[] content = ((ContentResponse)response).getContent();
+ if (content != null && content.length > 0)
+ notifyContent(listeners, response, ByteBuffer.wrap(content), Callback.NOOP);
+ }
}
public void forwardFailureComplete(List listeners, Request request, Throwable requestFailure, Response response, Throwable responseFailure)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
index 8c353e98f79f..9ef6bd7c49ef 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
@@ -26,6 +26,7 @@
import org.eclipse.jetty.client.HttpDestination;
import org.eclipse.jetty.client.Origin;
import org.eclipse.jetty.client.api.Connection;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.ProcessorUtils;
import org.eclipse.jetty.util.Promise;
@@ -36,12 +37,18 @@ public class HttpClientTransportOverHTTP extends AbstractConnectorHttpClientTran
{
public HttpClientTransportOverHTTP()
{
- this(Math.max( 1, ProcessorUtils.availableProcessors() / 2));
+ this(Math.max(1, ProcessorUtils.availableProcessors() / 2));
}
public HttpClientTransportOverHTTP(int selectors)
{
- super(selectors);
+ this(new ClientConnector());
+ getClientConnector().setSelectors(selectors);
+ }
+
+ public HttpClientTransportOverHTTP(ClientConnector connector)
+ {
+ super(connector);
setConnectionPoolFactory(destination -> new DuplexConnectionPool(destination, getHttpClient().getMaxConnectionsPerDestination(), destination));
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java
index 001989b79137..746e54ec2b02 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java
@@ -93,7 +93,6 @@ public long getBytesOut()
return bytesOut.longValue();
}
-
protected void addBytesOut(long bytesOut)
{
this.bytesOut.add(bytesOut);
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java
index 529df7b41121..4dffe0b939bc 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java
@@ -18,9 +18,6 @@
package org.eclipse.jetty.client;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;
@@ -49,9 +46,11 @@
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.jupiter.api.AfterEach;
-
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class HttpClientCustomProxyTest
{
public static final byte[] CAFE_BABE = new byte[]{(byte)0xCA, (byte)0xFE, (byte)0xBA, (byte)0xBE};
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
index b32c271ff45a..9fba73442ca6 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
@@ -18,16 +18,6 @@
package org.eclipse.jetty.client;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -106,6 +96,16 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@ExtendWith(WorkDirExtension.class)
public class HttpClientTest extends AbstractHttpClientServerTest
{
@@ -1716,10 +1716,12 @@ public void test204WithContent(Scenario scenario) throws Exception
try (ServerSocket server = new ServerSocket(0))
{
- startClient(scenario);
- client.setMaxConnectionsPerDestination(1);
int idleTimeout = 2000;
- client.setIdleTimeout(idleTimeout);
+ startClient(scenario, null, httpClient ->
+ {
+ httpClient.setMaxConnectionsPerDestination(1);
+ httpClient.setIdleTimeout(idleTimeout);
+ });
Request request = client.newRequest("localhost", server.getLocalPort())
.scheme(scenario.getScheme())
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/InsufficientThreadsDetectionTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/InsufficientThreadsDetectionTest.java
index ea209422f799..86051d6f8d71 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/InsufficientThreadsDetectionTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/InsufficientThreadsDetectionTest.java
@@ -18,13 +18,12 @@
package org.eclipse.jetty.client;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
-
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
public class InsufficientThreadsDetectionTest
{
@Test
@@ -33,9 +32,7 @@ public void testInsufficientThreads()
QueuedThreadPool clientThreads = new QueuedThreadPool(1);
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP(1), null);
httpClient.setExecutor(clientThreads);
- assertThrows(IllegalStateException.class, ()->{
- httpClient.start();
- });
+ assertThrows(IllegalStateException.class, httpClient::start);
}
@Test
@@ -46,7 +43,8 @@ public void testInsufficientThreadsForMultipleHttpClients() throws Exception
httpClient1.setExecutor(clientThreads);
httpClient1.start();
- assertThrows(IllegalStateException.class, ()->{
+ assertThrows(IllegalStateException.class, () ->
+ {
// Share the same thread pool with another instance.
HttpClient httpClient2 = new HttpClient(new HttpClientTransportOverHTTP(1), null);
httpClient2.setExecutor(clientThreads);
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java
index 1d10407b6bbf..7dff8d953a71 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java
@@ -18,9 +18,6 @@
package org.eclipse.jetty.client.http;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.*;
-
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
@@ -39,10 +36,18 @@
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpHeaderValue;
import org.hamcrest.Matchers;
-import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest
{
@ParameterizedTest
@@ -178,10 +183,9 @@ public void test_Acquire_Process_Release_Acquire_ReturnsSameConnection(Scenario
@ArgumentsSource(ScenarioProvider.class)
public void test_IdleConnection_IdleTimeout(Scenario scenario) throws Exception
{
- start(scenario, new EmptyServerHandler());
-
+ startServer(scenario, new EmptyServerHandler());
long idleTimeout = 1000;
- client.setIdleTimeout(idleTimeout);
+ startClient(scenario, null, httpClient -> httpClient.setIdleTimeout(idleTimeout));
try (HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())))
{
diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
index 4ab77cb2d57e..2c095ee2dab4 100644
--- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
+++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
@@ -29,6 +29,7 @@
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.fcgi.FCGI;
import org.eclipse.jetty.http.HttpFields;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.ProcessorUtils;
import org.eclipse.jetty.util.Promise;
@@ -47,7 +48,13 @@ public HttpClientTransportOverFCGI(String scriptRoot)
public HttpClientTransportOverFCGI(int selectors, String scriptRoot)
{
- super(selectors);
+ this(new ClientConnector(), scriptRoot);
+ getClientConnector().setSelectors(selectors);
+ }
+
+ public HttpClientTransportOverFCGI(ClientConnector connector, String scriptRoot)
+ {
+ super(connector);
this.scriptRoot = scriptRoot;
setConnectionPoolFactory(destination ->
{
diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java
index 3b969874d63f..a058215190a3 100644
--- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java
+++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java
@@ -18,13 +18,10 @@
package org.eclipse.jetty.http2.client;
-import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
-import java.util.Arrays;
+import java.time.Duration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -38,32 +35,24 @@
import org.eclipse.jetty.http2.frames.SettingsFrame;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.ClientConnectionFactory;
-import org.eclipse.jetty.io.Connection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.ManagedSelector;
-import org.eclipse.jetty.io.MappedByteBufferPool;
-import org.eclipse.jetty.io.SelectorManager;
-import org.eclipse.jetty.io.SocketChannelEndPoint;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
import org.eclipse.jetty.util.thread.Scheduler;
/**
- * {@link HTTP2Client} provides an asynchronous, non-blocking implementation
+ *
HTTP2Client provides an asynchronous, non-blocking implementation
* to send HTTP/2 frames to a server.
* Typical usage:
*
* // Create and start HTTP2Client.
* HTTP2Client client = new HTTP2Client();
- * SslContextFactory sslContextFactory = new SslContextFactory();
- * client.addBean(sslContextFactory);
* client.start();
+ * SslContextFactory sslContextFactory = client.getClientConnector().getSslContextFactory();
*
* // Connect to host.
* String host = "webtide.com";
@@ -108,7 +97,7 @@
* // Use the Stream object to send request content, if any, using a DATA frame.
* ByteBuffer content = ...;
* DataFrame requestContent = new DataFrame(stream.getId(), content, true);
- * stream.data(requestContent, Callback.Adapter.INSTANCE);
+ * stream.data(requestContent, Callback.NOOP);
*
* // When done, stop the client.
* client.stop();
@@ -117,18 +106,9 @@
@ManagedObject
public class HTTP2Client extends ContainerLifeCycle
{
- private Executor executor;
- private Scheduler scheduler;
- private ByteBufferPool bufferPool;
- private ClientConnectionFactory connectionFactory;
- private SelectorManager selector;
- private int selectors = 1;
- private long idleTimeout = 30000;
- private long connectTimeout = 10000;
- private boolean connectBlocking;
- private SocketAddress bindAddress;
+ private final ClientConnector connector;
private int inputBufferSize = 8192;
- private List protocols = Arrays.asList("h2", "h2-17", "h2-16", "h2-15", "h2-14");
+ private List protocols = List.of("h2");
private int initialSessionRecvWindow = 16 * 1024 * 1024;
private int initialStreamRecvWindow = 8 * 1024 * 1024;
private int maxFrameLength = Frame.DEFAULT_MAX_LENGTH;
@@ -136,96 +116,50 @@ public class HTTP2Client extends ContainerLifeCycle
private int maxSettingsKeys = SettingsFrame.DEFAULT_MAX_KEYS;
private FlowControlStrategy.Factory flowControlStrategyFactory = () -> new BufferingFlowControlStrategy(0.5F);
- @Override
- protected void doStart() throws Exception
+ public HTTP2Client()
{
- if (executor == null)
- setExecutor(new QueuedThreadPool());
-
- if (scheduler == null)
- setScheduler(new ScheduledExecutorScheduler());
-
- if (bufferPool == null)
- setByteBufferPool(new MappedByteBufferPool());
-
- if (connectionFactory == null)
- {
- HTTP2ClientConnectionFactory h2 = new HTTP2ClientConnectionFactory();
- setClientConnectionFactory((endPoint, context) ->
- {
- ClientConnectionFactory factory = h2;
- SslContextFactory sslContextFactory = (SslContextFactory)context.get(SslClientConnectionFactory.SSL_CONTEXT_FACTORY_CONTEXT_KEY);
- if (sslContextFactory != null)
- {
- ALPNClientConnectionFactory alpn = new ALPNClientConnectionFactory(getExecutor(), h2, getProtocols());
- factory = newSslClientConnectionFactory(sslContextFactory, alpn);
- }
- return factory.newConnection(endPoint, context);
- });
- }
-
- if (selector == null)
- {
- selector = newSelectorManager();
- addBean(selector);
- }
- selector.setConnectTimeout(getConnectTimeout());
-
- super.doStart();
+ this(new ClientConnector());
}
- protected SelectorManager newSelectorManager()
+ public HTTP2Client(ClientConnector connector)
{
- return new ClientSelectorManager(getExecutor(), getScheduler(), getSelectors());
+ this.connector = connector;
+ addBean(connector);
}
- protected ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory)
+ public ClientConnector getClientConnector()
{
- return new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), connectionFactory);
+ return connector;
}
public Executor getExecutor()
{
- return executor;
+ return connector.getExecutor();
}
public void setExecutor(Executor executor)
{
- this.updateBean(this.executor, executor);
- this.executor = executor;
+ connector.setExecutor(executor);
}
public Scheduler getScheduler()
{
- return scheduler;
+ return connector.getScheduler();
}
public void setScheduler(Scheduler scheduler)
{
- this.updateBean(this.scheduler, scheduler);
- this.scheduler = scheduler;
+ connector.setScheduler(scheduler);
}
public ByteBufferPool getByteBufferPool()
{
- return bufferPool;
+ return connector.getByteBufferPool();
}
public void setByteBufferPool(ByteBufferPool bufferPool)
{
- this.updateBean(this.bufferPool, bufferPool);
- this.bufferPool = bufferPool;
- }
-
- public ClientConnectionFactory getClientConnectionFactory()
- {
- return connectionFactory;
- }
-
- public void setClientConnectionFactory(ClientConnectionFactory connectionFactory)
- {
- this.updateBean(this.connectionFactory, connectionFactory);
- this.connectionFactory = connectionFactory;
+ connector.setByteBufferPool(bufferPool);
}
public FlowControlStrategy.Factory getFlowControlStrategyFactory()
@@ -241,58 +175,55 @@ public void setFlowControlStrategyFactory(FlowControlStrategy.Factory flowContro
@ManagedAttribute("The number of selectors")
public int getSelectors()
{
- return selectors;
+ return connector.getSelectors();
}
public void setSelectors(int selectors)
{
- this.selectors = selectors;
+ connector.setSelectors(selectors);
}
@ManagedAttribute("The idle timeout in milliseconds")
public long getIdleTimeout()
{
- return idleTimeout;
+ return connector.getIdleTimeout().toMillis();
}
public void setIdleTimeout(long idleTimeout)
{
- this.idleTimeout = idleTimeout;
+ connector.setIdleTimeout(Duration.ofMillis(idleTimeout));
}
@ManagedAttribute("The connect timeout in milliseconds")
public long getConnectTimeout()
{
- return connectTimeout;
+ return connector.getConnectTimeout().toMillis();
}
public void setConnectTimeout(long connectTimeout)
{
- this.connectTimeout = connectTimeout;
- SelectorManager selector = this.selector;
- if (selector != null)
- selector.setConnectTimeout(connectTimeout);
+ connector.setConnectTimeout(Duration.ofMillis(connectTimeout));
}
@ManagedAttribute("Whether the connect() operation is blocking")
public boolean isConnectBlocking()
{
- return connectBlocking;
+ return connector.isConnectBlocking();
}
public void setConnectBlocking(boolean connectBlocking)
{
- this.connectBlocking = connectBlocking;
+ connector.setConnectBlocking(connectBlocking);
}
public SocketAddress getBindAddress()
{
- return bindAddress;
+ return connector.getBindAddress();
}
public void setBindAddress(SocketAddress bindAddress)
{
- this.bindAddress = bindAddress;
+ connector.setBindAddress(bindAddress);
}
@ManagedAttribute("The size of the buffer used to read from the network")
@@ -374,6 +305,7 @@ public void setMaxSettingsKeys(int maxSettingsKeys)
public void connect(InetSocketAddress address, Session.Listener listener, Promise promise)
{
+ // Prior-knowledge clear-text HTTP/2 (h2c).
connect(null, address, listener, promise);
}
@@ -384,112 +316,49 @@ public void connect(SslContextFactory sslContextFactory, InetSocketAddress addre
public void connect(SslContextFactory sslContextFactory, InetSocketAddress address, Session.Listener listener, Promise promise, Map context)
{
- try
- {
- SocketChannel channel = SocketChannel.open();
- SocketAddress bindAddress = getBindAddress();
- if (bindAddress != null)
- channel.bind(bindAddress);
- configure(channel);
- boolean connected = true;
- if (isConnectBlocking())
- {
- channel.socket().connect(address, (int)getConnectTimeout());
- channel.configureBlocking(false);
- }
- else
- {
- channel.configureBlocking(false);
- connected = channel.connect(address);
- }
- context = contextFrom(sslContextFactory, address, listener, promise, context);
- if (connected)
- selector.accept(channel, context);
- else
- selector.connect(channel, context);
- }
- catch (Throwable x)
- {
- promise.failed(x);
- }
+ ClientConnectionFactory factory = newClientConnectionFactory(sslContextFactory);
+ connect(address, factory, listener, promise, context);
+ }
+
+ public void connect(SocketAddress address, ClientConnectionFactory factory, Session.Listener listener, Promise promise, Map context)
+ {
+ context = contextFrom(factory, listener, promise, context);
+ context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise));
+ connector.connect(address, context);
}
public void accept(SslContextFactory sslContextFactory, SocketChannel channel, Session.Listener listener, Promise promise)
{
- try
- {
- if (!channel.isConnected())
- throw new IllegalStateException("SocketChannel must be connected");
- channel.configureBlocking(false);
- Map context = contextFrom(sslContextFactory, (InetSocketAddress)channel.getRemoteAddress(), listener, promise, null);
- selector.accept(channel, context);
- }
- catch (Throwable x)
- {
- promise.failed(x);
- }
+ ClientConnectionFactory factory = newClientConnectionFactory(sslContextFactory);
+ accept(channel, factory, listener, promise);
}
- private Map contextFrom(SslContextFactory sslContextFactory, InetSocketAddress address, Session.Listener listener, Promise promise, Map context)
+ public void accept(SocketChannel channel, ClientConnectionFactory factory, Session.Listener listener, Promise promise)
+ {
+ Map context = contextFrom(factory, listener, promise, null);
+ context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise));
+ connector.accept(channel, context);
+ }
+
+ private Map contextFrom(ClientConnectionFactory factory, Session.Listener listener, Promise promise, Map context)
{
if (context == null)
context = new HashMap<>();
context.put(HTTP2ClientConnectionFactory.CLIENT_CONTEXT_KEY, this);
context.put(HTTP2ClientConnectionFactory.SESSION_LISTENER_CONTEXT_KEY, listener);
context.put(HTTP2ClientConnectionFactory.SESSION_PROMISE_CONTEXT_KEY, promise);
- if (sslContextFactory != null)
- context.put(SslClientConnectionFactory.SSL_CONTEXT_FACTORY_CONTEXT_KEY, sslContextFactory);
- context.put(SslClientConnectionFactory.SSL_PEER_HOST_CONTEXT_KEY, address.getHostString());
- context.put(SslClientConnectionFactory.SSL_PEER_PORT_CONTEXT_KEY, address.getPort());
- context.putIfAbsent(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY, this);
+ context.put(ClientConnector.CLIENT_CONNECTION_FACTORY_CONTEXT_KEY, factory);
return context;
}
- protected void configure(SocketChannel channel) throws IOException
- {
- channel.socket().setTcpNoDelay(true);
- }
-
- private class ClientSelectorManager extends SelectorManager
+ private ClientConnectionFactory newClientConnectionFactory(SslContextFactory sslContextFactory)
{
- private ClientSelectorManager(Executor executor, Scheduler scheduler, int selectors)
- {
- super(executor, scheduler, selectors);
- }
-
- @Override
- protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) throws IOException
- {
- SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, selectionKey, getScheduler());
- endp.setIdleTimeout(getIdleTimeout());
- return endp;
- }
-
- @Override
- public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException
- {
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- context.put(HTTP2ClientConnectionFactory.BYTE_BUFFER_POOL_CONTEXT_KEY, getByteBufferPool());
- context.put(HTTP2ClientConnectionFactory.EXECUTOR_CONTEXT_KEY, getExecutor());
- context.put(HTTP2ClientConnectionFactory.SCHEDULER_CONTEXT_KEY, getScheduler());
- return getClientConnectionFactory().newConnection(endpoint, context);
- }
-
- @Override
- protected void connectionFailed(SelectableChannel channel, Throwable failure, Object attachment)
+ ClientConnectionFactory factory = new HTTP2ClientConnectionFactory();
+ if (sslContextFactory != null)
{
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- if (LOG.isDebugEnabled())
- {
- Object host = context.get(SslClientConnectionFactory.SSL_PEER_HOST_CONTEXT_KEY);
- Object port = context.get(SslClientConnectionFactory.SSL_PEER_PORT_CONTEXT_KEY);
- LOG.debug("Could not connect to {}:{}", host, port);
- }
- @SuppressWarnings("unchecked")
- Promise promise = (Promise)context.get(HTTP2ClientConnectionFactory.SESSION_PROMISE_CONTEXT_KEY);
- promise.failed(failure);
+ ALPNClientConnectionFactory alpn = new ALPNClientConnectionFactory(getExecutor(), factory, getProtocols());
+ factory = new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), alpn);
}
+ return factory;
}
}
diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java
index cfe45c13d49e..5236e9e143e5 100644
--- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java
+++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java
@@ -42,12 +42,9 @@
public class HTTP2ClientConnectionFactory implements ClientConnectionFactory
{
- public static final String CLIENT_CONTEXT_KEY = "http2.client";
- public static final String BYTE_BUFFER_POOL_CONTEXT_KEY = "http2.client.byteBufferPool";
- public static final String EXECUTOR_CONTEXT_KEY = "http2.client.executor";
- public static final String SCHEDULER_CONTEXT_KEY = "http2.client.scheduler";
- public static final String SESSION_LISTENER_CONTEXT_KEY = "http2.client.sessionListener";
- public static final String SESSION_PROMISE_CONTEXT_KEY = "http2.client.sessionPromise";
+ public static final String CLIENT_CONTEXT_KEY = "org.eclipse.jetty.client.http2";
+ public static final String SESSION_LISTENER_CONTEXT_KEY = "org.eclipse.jetty.client.http2.sessionListener";
+ public static final String SESSION_PROMISE_CONTEXT_KEY = "org.eclipse.jetty.client.http2.sessionPromise";
private final Connection.Listener connectionListener = new ConnectionListener();
@@ -55,9 +52,9 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory
public Connection newConnection(EndPoint endPoint, Map context)
{
HTTP2Client client = (HTTP2Client)context.get(CLIENT_CONTEXT_KEY);
- ByteBufferPool byteBufferPool = (ByteBufferPool)context.get(BYTE_BUFFER_POOL_CONTEXT_KEY);
- Executor executor = (Executor)context.get(EXECUTOR_CONTEXT_KEY);
- Scheduler scheduler = (Scheduler)context.get(SCHEDULER_CONTEXT_KEY);
+ ByteBufferPool byteBufferPool = client.getByteBufferPool();
+ Executor executor = client.getExecutor();
+ Scheduler scheduler = client.getScheduler();
Session.Listener listener = (Session.Listener)context.get(SESSION_LISTENER_CONTEXT_KEY);
@SuppressWarnings("unchecked")
Promise promise = (Promise)context.get(SESSION_PROMISE_CONTEXT_KEY);
diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java
deleted file mode 100644
index 956a7b39c8f9..000000000000
--- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.http2.client;
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.Phaser;
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.http.HttpFields;
-import org.eclipse.jetty.http.HttpURI;
-import org.eclipse.jetty.http.HttpVersion;
-import org.eclipse.jetty.http.MetaData;
-import org.eclipse.jetty.http2.api.Session;
-import org.eclipse.jetty.http2.api.Stream;
-import org.eclipse.jetty.http2.api.server.ServerSessionListener;
-import org.eclipse.jetty.http2.frames.DataFrame;
-import org.eclipse.jetty.http2.frames.HeadersFrame;
-import org.eclipse.jetty.http2.frames.PushPromiseFrame;
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.FuturePromise;
-import org.eclipse.jetty.util.Jetty;
-import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-
-public class Client
-{
- public static void main(String[] args) throws Exception
- {
- HTTP2Client client = new HTTP2Client();
- SslContextFactory sslContextFactory = new SslContextFactory();
- client.addBean(sslContextFactory);
- client.start();
-
- String host = "webtide.com";
- int port = 443;
-
- FuturePromise sessionPromise = new FuturePromise<>();
- client.connect(sslContextFactory, new InetSocketAddress(host, port), new ServerSessionListener.Adapter(), sessionPromise);
- Session session = sessionPromise.get(5, TimeUnit.SECONDS);
-
- HttpFields requestFields = new HttpFields();
- requestFields.put("User-Agent", client.getClass().getName() + "/" + Jetty.VERSION);
- MetaData.Request metaData = new MetaData.Request("GET", new HttpURI("https://" + host + ":" + port + "/"), HttpVersion.HTTP_2, requestFields);
- HeadersFrame headersFrame = new HeadersFrame(metaData, null, true);
- final Phaser phaser = new Phaser(2);
- session.newStream(headersFrame, new Promise.Adapter<>(), new Stream.Listener.Adapter()
- {
- @Override
- public void onHeaders(Stream stream, HeadersFrame frame)
- {
- System.err.println(frame);
- if (frame.isEndStream())
- phaser.arrive();
- }
-
- @Override
- public void onData(Stream stream, DataFrame frame, Callback callback)
- {
- System.err.println(frame);
- callback.succeeded();
- if (frame.isEndStream())
- phaser.arrive();
- }
-
- @Override
- public Stream.Listener onPush(Stream stream, PushPromiseFrame frame)
- {
- System.err.println(frame);
- phaser.register();
- return this;
- }
- });
-
- phaser.awaitAdvanceInterruptibly(phaser.arrive(), 5, TimeUnit.SECONDS);
-
- client.stop();
- }
-}
diff --git a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpClientTransportOverHTTP2.java b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpClientTransportOverHTTP2.java
index 7584d1966e1d..cacb023db7dd 100644
--- a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpClientTransportOverHTTP2.java
+++ b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpClientTransportOverHTTP2.java
@@ -45,7 +45,6 @@
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
@ManagedObject("The HTTP/2 client transport")
public class HttpClientTransportOverHTTP2 extends AbstractHttpClientTransport
@@ -101,13 +100,7 @@ protected void doStart() throws Exception
}
addBean(client);
super.doStart();
-
- this.connectionFactory = new HTTP2ClientConnectionFactory();
- client.setClientConnectionFactory((endPoint, context) ->
- {
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- return destination.getClientConnectionFactory().newConnection(endPoint, context);
- });
+ connectionFactory = new HTTP2ClientConnectionFactory();
}
@Override
@@ -134,16 +127,12 @@ public void connect(InetSocketAddress address, Map context)
SessionListenerPromise listenerPromise = new SessionListenerPromise(context);
HttpDestinationOverHTTP2 destination = (HttpDestinationOverHTTP2)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- SslContextFactory sslContextFactory = null;
- if (HttpScheme.HTTPS.is(destination.getScheme()))
- sslContextFactory = httpClient.getSslContextFactory();
-
- connect(sslContextFactory, address, listenerPromise, listenerPromise, context);
+ connect(address, destination.getClientConnectionFactory(), listenerPromise, listenerPromise, context);
}
- protected void connect(SslContextFactory sslContextFactory, InetSocketAddress address, Session.Listener listener, Promise promise, Map context)
+ protected void connect(InetSocketAddress address, ClientConnectionFactory factory, Session.Listener listener, Promise promise, Map context)
{
- getHTTP2Client().connect(sslContextFactory, address, listener, promise, context);
+ getHTTP2Client().connect(address, factory, listener, promise, context);
}
@Override
diff --git a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java
index cee3802220d2..21225c96a95b 100644
--- a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java
+++ b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/MaxConcurrentStreamsTest.java
@@ -51,11 +51,11 @@
import org.eclipse.jetty.http2.frames.ResetFrame;
import org.eclipse.jetty.http2.frames.SettingsFrame;
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
+import org.eclipse.jetty.io.ClientConnectionFactory;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.jupiter.api.Test;
@@ -171,9 +171,9 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r
client = new HttpClient(new HttpClientTransportOverHTTP2(new HTTP2Client())
{
@Override
- protected void connect(SslContextFactory sslContextFactory, InetSocketAddress address, Session.Listener listener, Promise promise, Map context)
+ protected void connect(InetSocketAddress address, ClientConnectionFactory factory, Session.Listener listener, Promise promise, Map context)
{
- super.connect(sslContextFactory, address, new Wrapper(listener)
+ super.connect(address, factory, new Wrapper(listener)
{
@Override
public void onSettings(Session session, SettingsFrame frame)
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnectionFactory.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnectionFactory.java
index 9902ce0d4e04..d935b3d1eb23 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnectionFactory.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnectionFactory.java
@@ -28,10 +28,9 @@
*/
public interface ClientConnectionFactory
{
- public static final String CONNECTOR_CONTEXT_KEY = "client.connector";
+ public static final String CLIENT_CONTEXT_KEY = "org.eclipse.jetty.client";
/**
- *
* @param endPoint the {@link org.eclipse.jetty.io.EndPoint} to link the newly created connection to
* @param context the context data to create the connection
* @return a new {@link Connection}
@@ -41,8 +40,9 @@ public interface ClientConnectionFactory
public default Connection customize(Connection connection, Map context)
{
- ContainerLifeCycle connector = (ContainerLifeCycle)context.get(CONNECTOR_CONTEXT_KEY);
- connector.getBeans(Connection.Listener.class).forEach(connection::addListener);
+ ContainerLifeCycle client = (ContainerLifeCycle)context.get(CLIENT_CONTEXT_KEY);
+ if (client != null)
+ client.getBeans(Connection.Listener.class).forEach(connection::addListener);
return connection;
}
}
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
new file mode 100644
index 000000000000..5bb069124fb9
--- /dev/null
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
@@ -0,0 +1,333 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.io;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.SocketChannel;
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+import org.eclipse.jetty.util.Promise;
+import org.eclipse.jetty.util.component.ContainerLifeCycle;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
+import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
+import org.eclipse.jetty.util.thread.Scheduler;
+
+public class ClientConnector extends ContainerLifeCycle
+{
+ public static final String CLIENT_CONNECTOR_CONTEXT_KEY = "org.eclipse.jetty.client.connector";
+ public static final String SOCKET_ADDRESS_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".socketAddress";
+ public static final String CLIENT_CONNECTION_FACTORY_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".clientConnectionFactory";
+ public static final String CONNECTION_PROMISE_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".connectionPromise";
+ private static final Logger LOG = Log.getLogger(ClientConnector.class);
+
+ private Executor executor;
+ private Scheduler scheduler;
+ private ByteBufferPool byteBufferPool;
+ private SslContextFactory sslContextFactory;
+ private SelectorManager selectorManager;
+ private int selectors = 1;
+ private boolean connectBlocking;
+ private Duration connectTimeout = Duration.ofSeconds(5);
+ private Duration idleTimeout = Duration.ofSeconds(30);
+ private SocketAddress bindAddress;
+
+ public Executor getExecutor()
+ {
+ return executor;
+ }
+
+ public void setExecutor(Executor executor)
+ {
+ if (isStarted())
+ throw new IllegalStateException();
+ updateBean(this.executor, executor);
+ this.executor = executor;
+ }
+
+ public Scheduler getScheduler()
+ {
+ return scheduler;
+ }
+
+ public void setScheduler(Scheduler scheduler)
+ {
+ if (isStarted())
+ throw new IllegalStateException();
+ updateBean(this.scheduler, scheduler);
+ this.scheduler = scheduler;
+ }
+
+ public ByteBufferPool getByteBufferPool()
+ {
+ return byteBufferPool;
+ }
+
+ public void setByteBufferPool(ByteBufferPool byteBufferPool)
+ {
+ if (isStarted())
+ throw new IllegalStateException();
+ updateBean(this.byteBufferPool, byteBufferPool);
+ this.byteBufferPool = byteBufferPool;
+ }
+
+ public SslContextFactory getSslContextFactory()
+ {
+ return sslContextFactory;
+ }
+
+ public void setSslContextFactory(SslContextFactory sslContextFactory)
+ {
+ if (isStarted())
+ throw new IllegalStateException();
+ updateBean(this.sslContextFactory, sslContextFactory);
+ this.sslContextFactory = sslContextFactory;
+ }
+
+ public int getSelectors()
+ {
+ return selectors;
+ }
+
+ public void setSelectors(int selectors)
+ {
+ if (isStarted())
+ throw new IllegalStateException();
+ this.selectors = selectors;
+ }
+
+ public boolean isConnectBlocking()
+ {
+ return connectBlocking;
+ }
+
+ public void setConnectBlocking(boolean connectBlocking)
+ {
+ this.connectBlocking = connectBlocking;
+ }
+
+ public Duration getConnectTimeout()
+ {
+ return connectTimeout;
+ }
+
+ public void setConnectTimeout(Duration connectTimeout)
+ {
+ this.connectTimeout = connectTimeout;
+ if (selectorManager != null)
+ selectorManager.setConnectTimeout(connectTimeout.toMillis());
+ }
+
+ public Duration getIdleTimeout()
+ {
+ return idleTimeout;
+ }
+
+ public void setIdleTimeout(Duration idleTimeout)
+ {
+ this.idleTimeout = idleTimeout;
+ }
+
+ public SocketAddress getBindAddress()
+ {
+ return bindAddress;
+ }
+
+ public void setBindAddress(SocketAddress bindAddress)
+ {
+ this.bindAddress = bindAddress;
+ }
+
+ @Override
+ protected void doStart() throws Exception
+ {
+ if (executor == null)
+ setExecutor(new QueuedThreadPool());
+ if (scheduler == null)
+ setScheduler(new ScheduledExecutorScheduler());
+ if (byteBufferPool == null)
+ setByteBufferPool(new MappedByteBufferPool());
+ if (sslContextFactory == null)
+ setSslContextFactory(newSslContextFactory());
+ selectorManager = newSelectorManager();
+ selectorManager.setConnectTimeout(getConnectTimeout().toMillis());
+ addBean(selectorManager);
+ super.doStart();
+ }
+
+ @Override
+ protected void doStop() throws Exception
+ {
+ super.doStop();
+ removeBean(selectorManager);
+ }
+
+ protected SslContextFactory newSslContextFactory()
+ {
+ SslContextFactory sslContextFactory = new SslContextFactory(false);
+ sslContextFactory.setEndpointIdentificationAlgorithm("HTTPS");
+ return sslContextFactory;
+ }
+
+ protected SelectorManager newSelectorManager()
+ {
+ return new ClientSelectorManager(getExecutor(), getScheduler(), getSelectors());
+ }
+
+ public void connect(SocketAddress address, Map context)
+ {
+ SocketChannel channel = null;
+ try
+ {
+ if (context == null)
+ context = new HashMap<>();
+ context.put(ClientConnector.CLIENT_CONNECTOR_CONTEXT_KEY, this);
+ context.putIfAbsent(SOCKET_ADDRESS_CONTEXT_KEY, address);
+
+ channel = SocketChannel.open();
+ SocketAddress bindAddress = getBindAddress();
+ if (bindAddress != null)
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Binding to {} to connect to {}", bindAddress, address);
+ channel.bind(bindAddress);
+ }
+ configure(channel);
+
+ boolean connected = true;
+ boolean blocking = isConnectBlocking();
+ if (LOG.isDebugEnabled())
+ LOG.debug("Connecting {} to {}", blocking ? "blocking" : "non-blocking", address);
+ if (blocking)
+ {
+ channel.socket().connect(address, (int)getConnectTimeout().toMillis());
+ channel.configureBlocking(false);
+ }
+ else
+ {
+ channel.configureBlocking(false);
+ connected = channel.connect(address);
+ }
+
+ if (connected)
+ selectorManager.accept(channel, context);
+ else
+ selectorManager.connect(channel, context);
+ }
+ // Must catch all exceptions, since some like
+ // UnresolvedAddressException are not IOExceptions.
+ catch (Throwable x)
+ {
+ // If IPv6 is not deployed, a generic SocketException "Network is unreachable"
+ // exception is being thrown, so we attempt to provide a better error message.
+ if (x.getClass() == SocketException.class)
+ x = new SocketException("Could not connect to " + address).initCause(x);
+
+ try
+ {
+ if (channel != null)
+ channel.close();
+ }
+ catch (IOException xx)
+ {
+ LOG.ignore(xx);
+ }
+ finally
+ {
+ connectFailed(x, context);
+ }
+ }
+ }
+
+ public void accept(SocketChannel channel, Map context)
+ {
+ try
+ {
+ context.put(ClientConnector.CLIENT_CONNECTOR_CONTEXT_KEY, this);
+
+ if (!channel.isConnected())
+ throw new IllegalStateException("SocketChannel must be connected");
+ configure(channel);
+ channel.configureBlocking(false);
+ selectorManager.accept(channel, context);
+ }
+ catch (Throwable failure)
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Could not accept {}", channel);
+ Promise> promise = (Promise>)context.get(CONNECTION_PROMISE_CONTEXT_KEY);
+ promise.failed(failure);
+ }
+ }
+
+ protected void configure(SocketChannel channel) throws IOException
+ {
+ channel.socket().setTcpNoDelay(true);
+ }
+
+ private void connectFailed(Throwable failure, Map context)
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Could not connect to {}", context.get(SOCKET_ADDRESS_CONTEXT_KEY));
+ Promise> promise = (Promise>)context.get(CONNECTION_PROMISE_CONTEXT_KEY);
+ promise.failed(failure);
+ }
+
+ private class ClientSelectorManager extends SelectorManager
+ {
+ private ClientSelectorManager(Executor executor, Scheduler scheduler, int selectors)
+ {
+ super(executor, scheduler, selectors);
+ }
+
+ @Override
+ protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)
+ {
+ SocketChannelEndPoint endPoint = new SocketChannelEndPoint(channel, selector, selectionKey, getScheduler());
+ endPoint.setIdleTimeout(getIdleTimeout().toMillis());
+ return endPoint;
+ }
+
+ @Override
+ public Connection newConnection(SelectableChannel channel, EndPoint endPoint, Object attachment) throws IOException
+ {
+ @SuppressWarnings("unchecked")
+ Map context = (Map)attachment;
+ ClientConnectionFactory factory = (ClientConnectionFactory)context.get(CLIENT_CONNECTION_FACTORY_CONTEXT_KEY);
+ return factory.newConnection(endPoint, context);
+ }
+
+ @Override
+ protected void connectionFailed(SelectableChannel channel, Throwable failure, Object attachment)
+ {
+ @SuppressWarnings("unchecked")
+ Map context = (Map)attachment;
+ connectFailed(failure, context);
+ }
+ }
+}
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java
index 932644d6e620..867f88957aac 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java
@@ -37,9 +37,9 @@ public abstract class NegotiatingClientConnection extends AbstractConnection
private final Map context;
private volatile boolean completed;
- protected NegotiatingClientConnection(EndPoint endp, Executor executor, SSLEngine sslEngine, ClientConnectionFactory connectionFactory, Map context)
+ protected NegotiatingClientConnection(EndPoint endPoint, Executor executor, SSLEngine sslEngine, ClientConnectionFactory connectionFactory, Map context)
{
- super(endp, executor);
+ super(endPoint, executor);
this.engine = sslEngine;
this.connectionFactory = connectionFactory;
this.context = context;
@@ -67,7 +67,7 @@ public void onOpen()
else
fillInterested();
}
- catch (IOException x)
+ catch (Throwable x)
{
close();
throw new RuntimeIOException(x);
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java
index a86fcb9f3c76..874f2a815aa6 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.io.ssl;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Executor;
@@ -27,6 +28,7 @@
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.ClientConnectionFactory;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
@@ -34,10 +36,7 @@
public class SslClientConnectionFactory implements ClientConnectionFactory
{
- public static final String SSL_CONTEXT_FACTORY_CONTEXT_KEY = "ssl.context.factory";
- public static final String SSL_PEER_HOST_CONTEXT_KEY = "ssl.peer.host";
- public static final String SSL_PEER_PORT_CONTEXT_KEY = "ssl.peer.port";
- public static final String SSL_ENGINE_CONTEXT_KEY = "ssl.engine";
+ public static final String SSL_ENGINE_CONTEXT_KEY = "org.eclipse.jetty.client.ssl.engine";
private final SslContextFactory sslContextFactory;
private final ByteBufferPool byteBufferPool;
@@ -88,9 +87,8 @@ public void setAllowMissingCloseMessage(boolean allowMissingCloseMessage)
@Override
public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
{
- String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY);
- int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY);
- SSLEngine engine = sslContextFactory.newSSLEngine(host, port);
+ InetSocketAddress address = (InetSocketAddress)context.get(ClientConnector.SOCKET_ADDRESS_CONTEXT_KEY);
+ SSLEngine engine = sslContextFactory.newSSLEngine(address);
engine.setUseClientMode(true);
context.put(SSL_ENGINE_CONTEXT_KEY, engine);
@@ -119,8 +117,9 @@ public Connection customize(Connection connection, Map context)
sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed());
sslConnection.setRenegotiationLimit(sslContextFactory.getRenegotiationLimit());
sslConnection.setAllowMissingCloseMessage(isAllowMissingCloseMessage());
- ContainerLifeCycle connector = (ContainerLifeCycle)context.get(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY);
- connector.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener);
+ ContainerLifeCycle client = (ContainerLifeCycle)context.get(ClientConnectionFactory.CLIENT_CONTEXT_KEY);
+ if (client != null)
+ client.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener);
}
return ClientConnectionFactory.super.customize(connection, context);
}
diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletTest.java
index a42b626d11aa..fe62af7044e9 100644
--- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletTest.java
+++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletTest.java
@@ -41,6 +41,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.zip.GZIPOutputStream;
@@ -171,16 +172,23 @@ private void startProxy(Class extends ProxyServlet> proxyServletClass, Map consumer) throws Exception
+ {
+ client = prepareClient(consumer);
+ }
+
+ private HttpClient prepareClient(Consumer consumer) throws Exception
{
QueuedThreadPool clientPool = new QueuedThreadPool();
clientPool.setName("client");
HttpClient result = new HttpClient();
result.setExecutor(clientPool);
result.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
+ if (consumer != null)
+ consumer.accept(result);
result.start();
return result;
}
@@ -987,7 +995,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
assertEquals(name, cookies.get(0).getName());
assertEquals(value1, cookies.get(0).getValue());
- HttpClient client2 = prepareClient();
+ HttpClient client2 = prepareClient(null);
try
{
String value2 = "2";
@@ -1373,10 +1381,8 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
}
});
startProxy(proxyServletClass);
- startClient();
-
long idleTimeout = 1000;
- client.setIdleTimeout(idleTimeout);
+ startClient(httpClient -> httpClient.setIdleTimeout(idleTimeout));
byte[] content = new byte[1024];
new Random().nextBytes(content);
diff --git a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
index 9e30713099aa..aa2c77463a82 100644
--- a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
+++ b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
@@ -21,85 +21,110 @@
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
-import java.net.SocketException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
-import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.channels.SocketChannel;
import java.util.Map;
+import jnr.enxio.channels.NativeSelectorProvider;
+import jnr.unixsocket.UnixSocketAddress;
+import jnr.unixsocket.UnixSocketChannel;
+import org.eclipse.jetty.client.AbstractHttpClientTransport;
+import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpDestination;
-import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;
+import org.eclipse.jetty.client.Origin;
+import org.eclipse.jetty.client.http.HttpConnectionOverHTTP;
+import org.eclipse.jetty.client.http.HttpDestinationOverHTTP;
+import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ManagedSelector;
import org.eclipse.jetty.io.SelectorManager;
-import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
import org.eclipse.jetty.unixsocket.UnixSocketEndPoint;
+import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
-import jnr.enxio.channels.NativeSelectorProvider;
-import jnr.unixsocket.UnixSocketAddress;
-import jnr.unixsocket.UnixSocketChannel;
-
-public class HttpClientTransportOverUnixSockets
- extends HttpClientTransportOverHTTP
+// TODO: this class needs a thorough review.
+public class HttpClientTransportOverUnixSockets extends AbstractHttpClientTransport
{
- private static final Logger LOG = Log.getLogger( HttpClientTransportOverUnixSockets.class );
-
+ private static final Logger LOG = Log.getLogger(HttpClientTransportOverUnixSockets.class);
+
private String _unixSocket;
private SelectorManager selectorManager;
private UnixSocketChannel channel;
- public HttpClientTransportOverUnixSockets( String unixSocket )
+ public HttpClientTransportOverUnixSockets(String unixSocket)
{
- if ( unixSocket == null )
- {
- throw new IllegalArgumentException( "Unix socket file cannot be null" );
- }
+ if (unixSocket == null)
+ throw new IllegalArgumentException("Unix socket file cannot be null");
this._unixSocket = unixSocket;
+ setConnectionPoolFactory(destination ->
+ {
+ HttpClient httpClient = getHttpClient();
+ int maxConnections = httpClient.getMaxConnectionsPerDestination();
+ return new DuplexConnectionPool(destination, maxConnections, destination);
+ });
}
@Override
- protected SelectorManager newSelectorManager(HttpClient client)
+ protected void doStart() throws Exception
{
- return selectorManager = new UnixSocketSelectorManager(client,getSelectors());
+ HttpClient httpClient = getHttpClient();
+ selectorManager = new UnixSocketSelectorManager(httpClient, 1);
+ selectorManager.setConnectTimeout(httpClient.getConnectTimeout());
+ addBean(selectorManager);
+ super.doStart();
}
@Override
- public void connect( InetSocketAddress address, Map context )
+ protected void doStop() throws Exception
{
+ super.doStop();
+ try
+ {
+ if (channel != null)
+ channel.close();
+ }
+ catch (IOException xx)
+ {
+ LOG.ignore(xx);
+ }
+ }
+
+ @Override
+ public HttpDestination newHttpDestination(Origin origin)
+ {
+ return new HttpDestinationOverHTTP(getHttpClient(), origin);
+ }
+ @Override
+ public void connect(InetSocketAddress address, Map context)
+ {
try
{
InetAddress inet = address.getAddress();
if (!inet.isLoopbackAddress() && !inet.isLinkLocalAddress() && !inet.isSiteLocalAddress())
- throw new IOException("UnixSocket cannot connect to "+address.getHostString());
-
+ throw new IOException("UnixSocket cannot connect to " + address.getHostString());
+
// Open a unix socket
- UnixSocketAddress unixAddress = new UnixSocketAddress( this._unixSocket );
- channel = UnixSocketChannel.open( unixAddress );
-
+ UnixSocketAddress unixAddress = new UnixSocketAddress(this._unixSocket);
+ channel = UnixSocketChannel.open(unixAddress);
+
HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
HttpClient client = destination.getHttpClient();
configure(client, channel);
channel.configureBlocking(false);
- selectorManager.accept(channel, context);
+ selectorManager.accept(channel, context);
}
// Must catch all exceptions, since some like
// UnresolvedAddressException are not IOExceptions.
catch (Throwable x)
{
- // If IPv6 is not deployed, a generic SocketException "Network is unreachable"
- // exception is being thrown, so we attempt to provide a better error message.
- if (x.getClass() == SocketException.class)
- x = new SocketException("Could not connect to " + address).initCause(x);
-
try
{
if (channel != null)
@@ -116,11 +141,33 @@ public void connect( InetSocketAddress address, Map context )
}
}
- public class UnixSocketSelectorManager extends ClientSelectorManager
+ @Override
+ public Connection newConnection(EndPoint endPoint, Map context)
+ {
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ HttpConnectionOverHTTP connection = newHttpConnection(endPoint, destination, promise);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {}", connection);
+ return customize(connection, context);
+ }
+
+ protected HttpConnectionOverHTTP newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
+ {
+ return new HttpConnectionOverHTTP(endPoint, destination, promise);
+ }
+
+ protected void configure(HttpClient client, SocketChannel channel) throws IOException
+ {
+ channel.socket().setTcpNoDelay(client.isTCPNoDelay());
+ }
+
+ public class UnixSocketSelectorManager extends SelectorManager
{
protected UnixSocketSelectorManager(HttpClient client, int selectors)
{
- super(client,selectors);
+ super(client.getExecutor(), client.getScheduler(), selectors);
}
@Override
@@ -132,25 +179,26 @@ protected Selector newSelector() throws IOException
@Override
protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key)
{
- UnixSocketEndPoint endp = new UnixSocketEndPoint((UnixSocketChannel)channel, selector, key, getScheduler());
- endp.setIdleTimeout(getHttpClient().getIdleTimeout());
- return endp;
+ UnixSocketEndPoint endPoint = new UnixSocketEndPoint((UnixSocketChannel)channel, selector, key, getScheduler());
+ endPoint.setIdleTimeout(getHttpClient().getIdleTimeout());
+ return endPoint;
}
- }
- @Override
- protected void doStop()
- throws Exception
- {
- super.doStop();
- try
+ @Override
+ public Connection newConnection(SelectableChannel channel, EndPoint endPoint, Object attachment) throws IOException
{
- if (channel != null)
- channel.close();
+ @SuppressWarnings("unchecked")
+ Map context = (Map)attachment;
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ return destination.getClientConnectionFactory().newConnection(endPoint, context);
}
- catch (IOException xx)
+
+ @Override
+ protected void connectionFailed(SelectableChannel channel, Throwable x, Object attachment)
{
- LOG.ignore(xx);
+ @SuppressWarnings("unchecked")
+ Map context = (Map)attachment;
+ connectFailed(context, x);
}
}
}
diff --git a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java b/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
index 682d55c78d1d..3481fcb0daf3 100644
--- a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
+++ b/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
@@ -18,14 +18,6 @@
package org.eclipse.jetty.unixsocket;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.condition.OS.LINUX;
-import static org.junit.jupiter.api.condition.OS.MAC;
-
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
@@ -34,7 +26,6 @@
import java.util.Date;
import java.util.concurrent.ExecutionException;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -54,6 +45,14 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.condition.OS.LINUX;
+import static org.junit.jupiter.api.condition.OS.MAC;
+
@EnabledOnOs({LINUX, MAC})
public class UnixSocketTest
{
@@ -68,94 +67,86 @@ public void before() throws Exception
{
server = null;
httpClient = null;
- String unixSocketTmp = System.getProperty( "unix.socket.tmp" );
- if(StringUtil.isNotBlank( unixSocketTmp ) )
- {
- sockFile = Files.createTempFile( Paths.get(unixSocketTmp), "unix", ".sock" );
- } else {
- sockFile = Files.createTempFile("unix", ".sock" );
- }
- assertTrue(Files.deleteIfExists(sockFile),"temp sock file cannot be deleted");
+ String unixSocketTmp = System.getProperty("unix.socket.tmp");
+ if (StringUtil.isNotBlank(unixSocketTmp))
+ sockFile = Files.createTempFile(Paths.get(unixSocketTmp), "unix", ".sock");
+ else
+ sockFile = Files.createTempFile("unix", ".sock");
+ assertTrue(Files.deleteIfExists(sockFile), "temp sock file cannot be deleted");
}
-
+
@AfterEach
public void after() throws Exception
{
- if (httpClient!=null)
+ if (httpClient != null)
httpClient.stop();
- if (server!=null)
+ if (server != null)
server.stop();
// Force delete, this will fail if UnixSocket was not closed properly in the implementation
- FS.delete( sockFile);
+ FS.delete(sockFile);
}
-
+
@Test
public void testUnixSocket() throws Exception
{
server = new Server();
-
HttpConnectionFactory http = new HttpConnectionFactory();
+ UnixSocketConnector connector = new UnixSocketConnector(server, http);
+ connector.setUnixSocket(sockFile.toString());
+ server.addConnector(connector);
- UnixSocketConnector connector = new UnixSocketConnector( server, http );
- connector.setUnixSocket( sockFile.toString() );
- server.addConnector( connector );
-
- server.setHandler( new AbstractHandler.ErrorDispatchHandler()
+ server.setHandler(new AbstractHandler.ErrorDispatchHandler()
{
@Override
- protected void doNonErrorHandle( String target, Request baseRequest, HttpServletRequest request,
- HttpServletResponse response )
- throws IOException, ServletException
+ protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
int l = 0;
- if ( request.getContentLength() != 0 )
+ if (request.getContentLength() != 0)
{
InputStream in = request.getInputStream();
byte[] buffer = new byte[4096];
int r = 0;
- while ( r >= 0 )
+ while (r >= 0)
{
l += r;
- r = in.read( buffer );
+ r = in.read(buffer);
}
}
- log.info( "UnixSocketTest: request received" );
- baseRequest.setHandled( true );
- response.setStatus( 200 );
- response.getWriter().write( "Hello World " + new Date() + "\r\n" );
+ log.info("UnixSocketTest: request received");
+ baseRequest.setHandled(true);
+ response.setStatus(200);
+ response.getWriter().write("Hello World " + new Date() + "\r\n");
response.getWriter().write(
- "remote=" + request.getRemoteAddr() + ":" + request.getRemotePort() + "\r\n" );
+ "remote=" + request.getRemoteAddr() + ":" + request.getRemotePort() + "\r\n");
response.getWriter().write(
- "local =" + request.getLocalAddr() + ":" + request.getLocalPort() + "\r\n" );
- response.getWriter().write( "read =" + l + "\r\n" );
+ "local =" + request.getLocalAddr() + ":" + request.getLocalPort() + "\r\n");
+ response.getWriter().write("read =" + l + "\r\n");
}
- } );
+ });
server.start();
- httpClient = new HttpClient( new HttpClientTransportOverUnixSockets( sockFile.toString() ), null );
+ httpClient = new HttpClient(new HttpClientTransportOverUnixSockets(sockFile.toString()), null);
httpClient.start();
ContentResponse contentResponse = httpClient
- .newRequest( "http://localhost" )
+ .newRequest("http://localhost")
.send();
- log.debug( "response from server: {}", contentResponse.getContentAsString() );
+ log.debug("response from server: {}", contentResponse.getContentAsString());
- assertThat(contentResponse.getContentAsString(), containsString( "Hello World" ));
+ assertThat(contentResponse.getContentAsString(), containsString("Hello World"));
}
@Test
public void testNotLocal() throws Exception
- {
- httpClient = new HttpClient( new HttpClientTransportOverUnixSockets( sockFile.toString() ), null );
+ {
+ httpClient = new HttpClient(new HttpClientTransportOverUnixSockets(sockFile.toString()), null);
httpClient.start();
-
- ExecutionException e = assertThrows(ExecutionException.class, ()->{
- httpClient.newRequest( "http://google.com" ).send();
- });
+
+ ExecutionException e = assertThrows(ExecutionException.class, () -> httpClient.newRequest("http://google.com").send());
assertThat(e.getCause(), instanceOf(IOException.class));
- assertThat(e.getCause().getMessage(),containsString("UnixSocket cannot connect to google.com"));
+ assertThat(e.getCause().getMessage(), containsString("UnixSocket cannot connect to google.com"));
}
}
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java
index ef651ee12e59..16c5fd66bdc7 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java
@@ -18,10 +18,6 @@
package org.eclipse.jetty.http.client;
-import static org.eclipse.jetty.http.client.Transport.H2C;
-import static org.eclipse.jetty.http.client.Transport.HTTP;
-import static org.hamcrest.MatcherAssert.assertThat;
-
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -44,6 +40,11 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static org.eclipse.jetty.http.client.Transport.H2C;
+import static org.eclipse.jetty.http.client.Transport.HTTP;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
public class ConnectionStatisticsTest extends AbstractTest
{
@Override
@@ -73,7 +74,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
{
@Override
public void onOpened(Connection connection)
- {
+ {
}
@Override
@@ -82,7 +83,7 @@ public void onClosed(Connection connection)
closed.countDown();
}
};
-
+
ConnectionStatistics serverStats = new ConnectionStatistics();
scenario.connector.addBean(serverStats);
scenario.connector.addBean(closer);
@@ -93,20 +94,20 @@ public void onClosed(Connection connection)
scenario.client.addBean(closer);
clientStats.start();
- scenario.client.setIdleTimeout(1000);
+ long idleTimeout = 1000;
+ scenario.client.setIdleTimeout(idleTimeout);
byte[] content = new byte[3072];
long contentLength = content.length;
ContentResponse response = scenario.client.newRequest(scenario.newURI())
- .header(HttpHeader.CONNECTION,"close")
+ .header(HttpHeader.CONNECTION, "close")
.content(new BytesContentProvider(content))
.timeout(5, TimeUnit.SECONDS)
.send();
assertThat(response.getStatus(), Matchers.equalTo(HttpStatus.OK_200));
+ assertTrue(closed.await(2 * idleTimeout, TimeUnit.MILLISECONDS));
- closed.await();
-
assertThat(serverStats.getConnectionsMax(), Matchers.greaterThan(0L));
assertThat(serverStats.getReceivedBytes(), Matchers.greaterThan(contentLength));
assertThat(serverStats.getSentBytes(), Matchers.greaterThan(contentLength));
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientContinueTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientContinueTest.java
index 082d7de6b9d4..28d59edf9db2 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientContinueTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientContinueTest.java
@@ -327,7 +327,7 @@ public void test_Expect100Continue_WithContent_WithResponseFailure_Before100Cont
{
init(transport);
final long idleTimeout = 1000;
- scenario.start(new AbstractHandler()
+ scenario.startServer(new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException
@@ -343,8 +343,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
}
}
});
-
- scenario.client.setIdleTimeout(2 * idleTimeout);
+ scenario.startClient(httpClient -> httpClient.setIdleTimeout(2 * idleTimeout));
byte[] content = new byte[1024];
final CountDownLatch latch = new CountDownLatch(1);
@@ -375,7 +374,7 @@ public void test_Expect100Continue_WithContent_WithResponseFailure_After100Conti
{
init(transport);
final long idleTimeout = 1000;
- scenario.start(new AbstractHandler()
+ scenario.startServer(new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
@@ -393,8 +392,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
}
}
});
-
- scenario.client.setIdleTimeout(idleTimeout);
+ scenario.startClient(httpClient -> httpClient.setIdleTimeout(idleTimeout));
byte[] content = new byte[1024];
final CountDownLatch latch = new CountDownLatch(1);
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientIdleTimeoutTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientIdleTimeoutTest.java
index 3cde40558bf1..6ba09196945e 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientIdleTimeoutTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientIdleTimeoutTest.java
@@ -18,9 +18,6 @@
package org.eclipse.jetty.http.client;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -37,6 +34,9 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class HttpClientIdleTimeoutTest extends AbstractTest
{
private long idleTimeout = 1000;
@@ -52,7 +52,7 @@ public void init(Transport transport) throws IOException
public void testClientIdleTimeout(Transport transport) throws Exception
{
init(transport);
- scenario.start(new AbstractHandler()
+ scenario.startServer(new AbstractHandler()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
@@ -65,9 +65,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
}
}
});
- scenario.client.stop();
- scenario.client.setIdleTimeout(idleTimeout);
- scenario.client.start();
+ scenario.startClient(httpClient -> httpClient.setIdleTimeout(idleTimeout));
final CountDownLatch latch = new CountDownLatch(1);
scenario.client.newRequest(scenario.newURI())
@@ -126,10 +124,8 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
public void testIdleClientIdleTimeout(Transport transport) throws Exception
{
init(transport);
- scenario.start(new EmptyServerHandler());
- scenario.client.stop();
- scenario.client.setIdleTimeout(idleTimeout);
- scenario.client.start();
+ scenario.startServer(new EmptyServerHandler());
+ scenario.startClient(httpClient -> httpClient.setIdleTimeout(idleTimeout));
// Make a first request to open a connection.
ContentResponse response = scenario.client.newRequest(scenario.newURI()).send();
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java
index 97eeb3727e8c..fc5934c7aeb5 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java
@@ -18,15 +18,6 @@
package org.eclipse.jetty.http.client;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
@@ -63,6 +54,15 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
public class HttpClientTest extends AbstractTest
{
@Override
@@ -453,7 +453,9 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
public void testConnectionListener(Transport transport) throws Exception
{
init(transport);
- scenario.start(new EmptyServerHandler());
+ scenario.startServer(new EmptyServerHandler());
+ long idleTimeout = 1000;
+ scenario.startClient(httpClient -> httpClient.setIdleTimeout(idleTimeout));
CountDownLatch openLatch = new CountDownLatch(1);
CountDownLatch closeLatch = new CountDownLatch(1);
@@ -472,9 +474,6 @@ public void onClosed(org.eclipse.jetty.io.Connection connection)
}
});
- long idleTimeout = 1000;
- scenario.client.setIdleTimeout(idleTimeout);
-
ContentResponse response = scenario.client.newRequest(scenario.newURI())
.scheme(scenario.getScheme())
.timeout(5, TimeUnit.SECONDS)
diff --git a/tests/test-http-client-transport/src/test/resources/jetty-logging.properties b/tests/test-http-client-transport/src/test/resources/jetty-logging.properties
index 1047ac8946d1..914cac87711b 100644
--- a/tests/test-http-client-transport/src/test/resources/jetty-logging.properties
+++ b/tests/test-http-client-transport/src/test/resources/jetty-logging.properties
@@ -2,6 +2,6 @@ org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
#org.eclipse.jetty.LEVEL=DEBUG
#org.eclipse.jetty.client.LEVEL=DEBUG
#org.eclipse.jetty.http2.LEVEL=DEBUG
-#org.eclipse.jetty.http2.hpack.LEVEL=INFO
+org.eclipse.jetty.http2.hpack.LEVEL=INFO
#org.eclipse.jetty.http2.client.LEVEL=DEBUG
#org.eclipse.jetty.io.LEVEL=DEBUG
From 64a2bc346ee7cb1c7155645db42afe70f1770d70 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Fri, 18 Jan 2019 08:48:27 +0100
Subject: [PATCH 21/35] Issue #132 - ClientConnector abstraction.
Added name to default executor and scheduler after review.
Signed-off-by: Simone Bordet
---
.../main/java/org/eclipse/jetty/io/ClientConnector.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
index 5bb069124fb9..540c6eeecdab 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
@@ -167,9 +167,13 @@ public void setBindAddress(SocketAddress bindAddress)
protected void doStart() throws Exception
{
if (executor == null)
- setExecutor(new QueuedThreadPool());
+ {
+ QueuedThreadPool clientThreads = new QueuedThreadPool();
+ clientThreads.setName(String.format("client-pool@%x", hashCode()));
+ setExecutor(clientThreads);
+ }
if (scheduler == null)
- setScheduler(new ScheduledExecutorScheduler());
+ setScheduler(new ScheduledExecutorScheduler(String.format("client-scheduler@%x", hashCode()), false));
if (byteBufferPool == null)
setByteBufferPool(new MappedByteBufferPool());
if (sslContextFactory == null)
From 51730a7ccfdfa68856f8818e585773242cc9bec5 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Tue, 22 Jan 2019 17:33:29 +0100
Subject: [PATCH 22/35] Issue #132 - ClientConnector abstraction.
Rewrote HttpClientTransportOverUnixSockets in light of ClientConnector.
Signed-off-by: Simone Bordet
---
.../AbstractConnectorHttpClientTransport.java | 16 ++
.../http/HttpClientTransportOverHTTP.java | 15 --
.../http/HttpClientTransportOverFCGI.java | 14 --
.../org/eclipse/jetty/io/ClientConnector.java | 38 ++--
.../jetty/unixsocket/UnixSocketEndPoint.java | 15 +-
.../HttpClientTransportOverUnixSockets.java | 176 ++++++------------
.../jetty/unixsocket/UnixSocketTest.java | 4 +-
7 files changed, 103 insertions(+), 175 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
index 0c234daa160f..efa92c222fa8 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
@@ -18,12 +18,14 @@
package org.eclipse.jetty.client;
+import java.io.IOException;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.Map;
import org.eclipse.jetty.client.api.Connection;
import org.eclipse.jetty.io.ClientConnector;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
@@ -75,4 +77,18 @@ public void connect(InetSocketAddress address, Map context)
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise));
connector.connect(address, context);
}
+
+ @Override
+ public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
+ {
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ org.eclipse.jetty.io.Connection connection = newHttpConnection(endPoint, destination, promise);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {}", connection);
+ return customize(connection, context);
+ }
+
+ protected abstract org.eclipse.jetty.io.Connection newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise);
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
index 9ef6bd7c49ef..52e0c350596e 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
@@ -18,9 +18,6 @@
package org.eclipse.jetty.client.http;
-import java.io.IOException;
-import java.util.Map;
-
import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport;
import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpDestination;
@@ -58,18 +55,6 @@ public HttpDestination newHttpDestination(Origin origin)
return new HttpDestinationOverHTTP(getHttpClient(), origin);
}
- @Override
- public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
- {
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- @SuppressWarnings("unchecked")
- Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
- HttpConnectionOverHTTP connection = newHttpConnection(endPoint, destination, promise);
- if (LOG.isDebugEnabled())
- LOG.debug("Created {}", connection);
- return customize(connection, context);
- }
-
protected HttpConnectionOverHTTP newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverHTTP(endPoint, destination, promise);
diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
index 2c095ee2dab4..455b8db66cc4 100644
--- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
+++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
@@ -18,8 +18,6 @@
package org.eclipse.jetty.fcgi.client.http;
-import java.util.Map;
-
import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport;
import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpClient;
@@ -76,18 +74,6 @@ public HttpDestination newHttpDestination(Origin origin)
return new HttpDestinationOverFCGI(getHttpClient(), origin);
}
- @Override
- public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context)
- {
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- @SuppressWarnings("unchecked")
- Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
- HttpConnectionOverFCGI connection = newHttpConnection(endPoint, destination, promise);
- if (LOG.isDebugEnabled())
- LOG.debug("Created {}", connection);
- return customize(connection, context);
- }
-
protected HttpConnectionOverFCGI newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverFCGI(endPoint, destination, promise);
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
index 540c6eeecdab..78cd26cfaba4 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
@@ -18,6 +18,7 @@
package org.eclipse.jetty.io;
+import java.io.Closeable;
import java.io.IOException;
import java.net.SocketAddress;
import java.net.SocketException;
@@ -251,20 +252,8 @@ public void connect(SocketAddress address, Map context)
// exception is being thrown, so we attempt to provide a better error message.
if (x.getClass() == SocketException.class)
x = new SocketException("Could not connect to " + address).initCause(x);
-
- try
- {
- if (channel != null)
- channel.close();
- }
- catch (IOException xx)
- {
- LOG.ignore(xx);
- }
- finally
- {
- connectFailed(x, context);
- }
+ safeClose(channel);
+ connectFailed(x, context);
}
}
@@ -273,7 +262,6 @@ public void accept(SocketChannel channel, Map context)
try
{
context.put(ClientConnector.CLIENT_CONNECTOR_CONTEXT_KEY, this);
-
if (!channel.isConnected())
throw new IllegalStateException("SocketChannel must be connected");
configure(channel);
@@ -284,17 +272,31 @@ public void accept(SocketChannel channel, Map context)
{
if (LOG.isDebugEnabled())
LOG.debug("Could not accept {}", channel);
+ safeClose(channel);
Promise> promise = (Promise>)context.get(CONNECTION_PROMISE_CONTEXT_KEY);
promise.failed(failure);
}
}
+ protected void safeClose(Closeable closeable)
+ {
+ try
+ {
+ if (closeable != null)
+ closeable.close();
+ }
+ catch (Throwable x)
+ {
+ LOG.ignore(x);
+ }
+ }
+
protected void configure(SocketChannel channel) throws IOException
{
channel.socket().setTcpNoDelay(true);
}
- private void connectFailed(Throwable failure, Map context)
+ protected void connectFailed(Throwable failure, Map context)
{
if (LOG.isDebugEnabled())
LOG.debug("Could not connect to {}", context.get(SOCKET_ADDRESS_CONTEXT_KEY));
@@ -302,9 +304,9 @@ private void connectFailed(Throwable failure, Map context)
promise.failed(failure);
}
- private class ClientSelectorManager extends SelectorManager
+ protected class ClientSelectorManager extends SelectorManager
{
- private ClientSelectorManager(Executor executor, Scheduler scheduler, int selectors)
+ protected ClientSelectorManager(Executor executor, Scheduler scheduler, int selectors)
{
super(executor, scheduler, selectors);
}
diff --git a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketEndPoint.java b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketEndPoint.java
index 3556b73c3908..57af91a5110b 100644
--- a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketEndPoint.java
+++ b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketEndPoint.java
@@ -20,31 +20,25 @@
import java.io.IOException;
import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
+import jnr.unixsocket.UnixSocketChannel;
import org.eclipse.jetty.io.ChannelEndPoint;
-import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.io.ManagedSelector;
-import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.thread.Scheduler;
-import jnr.unixsocket.UnixSocketChannel;
-
public class UnixSocketEndPoint extends ChannelEndPoint
{
private static final Logger LOG = Log.getLogger(UnixSocketEndPoint.class);
- private static final Logger CEPLOG = Log.getLogger(ChannelEndPoint.class);
-
private final UnixSocketChannel _channel;
-
+
public UnixSocketEndPoint(UnixSocketChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)
{
- super(channel,selector,key,scheduler);
- _channel=channel;
+ super(channel, selector, key, scheduler);
+ _channel = channel;
}
@Override
@@ -59,7 +53,6 @@ public InetSocketAddress getRemoteAddress()
return null;
}
-
@Override
protected void doShutdownOutput()
{
diff --git a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
index aa2c77463a82..be94307618e2 100644
--- a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
+++ b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
@@ -19,25 +19,28 @@
package org.eclipse.jetty.unixsocket.client;
import java.io.IOException;
+import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
+import java.net.SocketAddress;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Map;
+import java.util.concurrent.Executor;
import jnr.enxio.channels.NativeSelectorProvider;
import jnr.unixsocket.UnixSocketAddress;
import jnr.unixsocket.UnixSocketChannel;
-import org.eclipse.jetty.client.AbstractHttpClientTransport;
+import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport;
import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpDestination;
import org.eclipse.jetty.client.Origin;
import org.eclipse.jetty.client.http.HttpConnectionOverHTTP;
import org.eclipse.jetty.client.http.HttpDestinationOverHTTP;
-import org.eclipse.jetty.io.Connection;
+import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ManagedSelector;
import org.eclipse.jetty.io.SelectorManager;
@@ -45,22 +48,21 @@
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
+import org.eclipse.jetty.util.thread.Scheduler;
// TODO: this class needs a thorough review.
-public class HttpClientTransportOverUnixSockets extends AbstractHttpClientTransport
+public class HttpClientTransportOverUnixSockets extends AbstractConnectorHttpClientTransport
{
private static final Logger LOG = Log.getLogger(HttpClientTransportOverUnixSockets.class);
- private String _unixSocket;
- private SelectorManager selectorManager;
-
- private UnixSocketChannel channel;
-
public HttpClientTransportOverUnixSockets(String unixSocket)
{
- if (unixSocket == null)
- throw new IllegalArgumentException("Unix socket file cannot be null");
- this._unixSocket = unixSocket;
+ this(new UnixSocketClientConnector(unixSocket));
+ }
+
+ private HttpClientTransportOverUnixSockets(ClientConnector connector)
+ {
+ super(connector);
setConnectionPoolFactory(destination ->
{
HttpClient httpClient = getHttpClient();
@@ -69,136 +71,80 @@ public HttpClientTransportOverUnixSockets(String unixSocket)
});
}
- @Override
- protected void doStart() throws Exception
- {
- HttpClient httpClient = getHttpClient();
- selectorManager = new UnixSocketSelectorManager(httpClient, 1);
- selectorManager.setConnectTimeout(httpClient.getConnectTimeout());
- addBean(selectorManager);
- super.doStart();
- }
-
- @Override
- protected void doStop() throws Exception
- {
- super.doStop();
- try
- {
- if (channel != null)
- channel.close();
- }
- catch (IOException xx)
- {
- LOG.ignore(xx);
- }
- }
-
@Override
public HttpDestination newHttpDestination(Origin origin)
{
return new HttpDestinationOverHTTP(getHttpClient(), origin);
}
- @Override
- public void connect(InetSocketAddress address, Map context)
- {
- try
- {
- InetAddress inet = address.getAddress();
- if (!inet.isLoopbackAddress() && !inet.isLinkLocalAddress() && !inet.isSiteLocalAddress())
- throw new IOException("UnixSocket cannot connect to " + address.getHostString());
-
- // Open a unix socket
- UnixSocketAddress unixAddress = new UnixSocketAddress(this._unixSocket);
- channel = UnixSocketChannel.open(unixAddress);
-
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- HttpClient client = destination.getHttpClient();
-
- configure(client, channel);
-
- channel.configureBlocking(false);
- selectorManager.accept(channel, context);
- }
- // Must catch all exceptions, since some like
- // UnresolvedAddressException are not IOExceptions.
- catch (Throwable x)
- {
- try
- {
- if (channel != null)
- channel.close();
- }
- catch (IOException xx)
- {
- LOG.ignore(xx);
- }
- finally
- {
- connectFailed(context, x);
- }
- }
- }
-
- @Override
- public Connection newConnection(EndPoint endPoint, Map context)
- {
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- @SuppressWarnings("unchecked")
- Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
- HttpConnectionOverHTTP connection = newHttpConnection(endPoint, destination, promise);
- if (LOG.isDebugEnabled())
- LOG.debug("Created {}", connection);
- return customize(connection, context);
- }
-
protected HttpConnectionOverHTTP newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverHTTP(endPoint, destination, promise);
}
- protected void configure(HttpClient client, SocketChannel channel) throws IOException
+ private static class UnixSocketClientConnector extends ClientConnector
{
- channel.socket().setTcpNoDelay(client.isTCPNoDelay());
- }
+ private final String unixSocket;
- public class UnixSocketSelectorManager extends SelectorManager
- {
- protected UnixSocketSelectorManager(HttpClient client, int selectors)
+ private UnixSocketClientConnector(String unixSocket)
{
- super(client.getExecutor(), client.getScheduler(), selectors);
+ this.unixSocket = unixSocket;
}
@Override
- protected Selector newSelector() throws IOException
+ protected SelectorManager newSelectorManager()
{
- return NativeSelectorProvider.getInstance().openSelector();
+ return new UnixSocketSelectorManager(getExecutor(), getScheduler(), getSelectors());
}
@Override
- protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key)
+ public void connect(SocketAddress address, Map context)
{
- UnixSocketEndPoint endPoint = new UnixSocketEndPoint((UnixSocketChannel)channel, selector, key, getScheduler());
- endPoint.setIdleTimeout(getHttpClient().getIdleTimeout());
- return endPoint;
+ InetSocketAddress socketAddress = (InetSocketAddress)address;
+ InetAddress inetAddress = socketAddress.getAddress();
+ if (inetAddress.isLoopbackAddress() || inetAddress.isLinkLocalAddress() || inetAddress.isSiteLocalAddress())
+ {
+ SocketChannel channel = null;
+ try
+ {
+ UnixSocketAddress unixAddress = new UnixSocketAddress(unixSocket);
+ channel = UnixSocketChannel.open(unixAddress);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {} for {}", channel, unixAddress);
+ accept(channel, context);
+ }
+ catch (Throwable x)
+ {
+ safeClose(channel);
+ connectFailed(x, context);
+ }
+ }
+ else
+ {
+ connectFailed(new ConnectException("UnixSocket cannot connect to " + socketAddress.getHostString()), context);
+ }
}
- @Override
- public Connection newConnection(SelectableChannel channel, EndPoint endPoint, Object attachment) throws IOException
+ private class UnixSocketSelectorManager extends ClientSelectorManager
{
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- return destination.getClientConnectionFactory().newConnection(endPoint, context);
- }
+ private UnixSocketSelectorManager(Executor executor, Scheduler scheduler, int selectors)
+ {
+ super(executor, scheduler, selectors);
+ }
- @Override
- protected void connectionFailed(SelectableChannel channel, Throwable x, Object attachment)
- {
- @SuppressWarnings("unchecked")
- Map context = (Map)attachment;
- connectFailed(context, x);
+ @Override
+ protected Selector newSelector() throws IOException
+ {
+ return NativeSelectorProvider.getInstance().openSelector();
+ }
+
+ @Override
+ protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key)
+ {
+ UnixSocketEndPoint endPoint = new UnixSocketEndPoint((UnixSocketChannel)channel, selector, key, getScheduler());
+ endPoint.setIdleTimeout(getIdleTimeout().toMillis());
+ return endPoint;
+ }
}
}
}
diff --git a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java b/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
index 3481fcb0daf3..b7b8dddf8c93 100644
--- a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
+++ b/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.net.ConnectException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -146,7 +147,6 @@ public void testNotLocal() throws Exception
httpClient.start();
ExecutionException e = assertThrows(ExecutionException.class, () -> httpClient.newRequest("http://google.com").send());
- assertThat(e.getCause(), instanceOf(IOException.class));
- assertThat(e.getCause().getMessage(), containsString("UnixSocket cannot connect to google.com"));
+ assertThat(e.getCause(), instanceOf(ConnectException.class));
}
}
From 514c6dff1ee131862b86a868e87e0ac2940d10d5 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Tue, 22 Jan 2019 17:44:06 +0100
Subject: [PATCH 23/35] Issue #132 - ClientConnector abstraction.
Reverted refactoring of newConnection() to avoid
to bind the class to a too specific abstract method.
Signed-off-by: Simone Bordet
---
.../AbstractConnectorHttpClientTransport.java | 16 ----------------
.../client/http/HttpClientTransportOverHTTP.java | 15 +++++++++++++++
.../client/http/HttpClientTransportOverFCGI.java | 15 +++++++++++++++
.../HttpClientTransportOverUnixSockets.java | 13 +++++++++++++
4 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
index efa92c222fa8..0c234daa160f 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectorHttpClientTransport.java
@@ -18,14 +18,12 @@
package org.eclipse.jetty.client;
-import java.io.IOException;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.Map;
import org.eclipse.jetty.client.api.Connection;
import org.eclipse.jetty.io.ClientConnector;
-import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
@@ -77,18 +75,4 @@ public void connect(InetSocketAddress address, Map context)
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, new Promise.Wrapper<>(promise));
connector.connect(address, context);
}
-
- @Override
- public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
- {
- HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
- @SuppressWarnings("unchecked")
- Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
- org.eclipse.jetty.io.Connection connection = newHttpConnection(endPoint, destination, promise);
- if (LOG.isDebugEnabled())
- LOG.debug("Created {}", connection);
- return customize(connection, context);
- }
-
- protected abstract org.eclipse.jetty.io.Connection newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise);
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
index 52e0c350596e..ddfacc5f67a4 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java
@@ -18,6 +18,9 @@
package org.eclipse.jetty.client.http;
+import java.io.IOException;
+import java.util.Map;
+
import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport;
import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpDestination;
@@ -55,6 +58,18 @@ public HttpDestination newHttpDestination(Origin origin)
return new HttpDestinationOverHTTP(getHttpClient(), origin);
}
+ @Override
+ public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
+ {
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ org.eclipse.jetty.io.Connection connection = newHttpConnection(endPoint, destination, promise);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {}", connection);
+ return customize(connection, context);
+ }
+
protected HttpConnectionOverHTTP newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverHTTP(endPoint, destination, promise);
diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
index 455b8db66cc4..5a641c149998 100644
--- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
+++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java
@@ -18,6 +18,9 @@
package org.eclipse.jetty.fcgi.client.http;
+import java.io.IOException;
+import java.util.Map;
+
import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport;
import org.eclipse.jetty.client.DuplexConnectionPool;
import org.eclipse.jetty.client.HttpClient;
@@ -74,6 +77,18 @@ public HttpDestination newHttpDestination(Origin origin)
return new HttpDestinationOverFCGI(getHttpClient(), origin);
}
+ @Override
+ public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
+ {
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ org.eclipse.jetty.io.Connection connection = newHttpConnection(endPoint, destination, promise);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {}", connection);
+ return customize(connection, context);
+ }
+
protected HttpConnectionOverFCGI newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverFCGI(endPoint, destination, promise);
diff --git a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
index be94307618e2..36ea14e3bae9 100644
--- a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
+++ b/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java
@@ -38,6 +38,7 @@
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpDestination;
import org.eclipse.jetty.client.Origin;
+import org.eclipse.jetty.client.api.Connection;
import org.eclipse.jetty.client.http.HttpConnectionOverHTTP;
import org.eclipse.jetty.client.http.HttpDestinationOverHTTP;
import org.eclipse.jetty.io.ClientConnector;
@@ -77,6 +78,18 @@ public HttpDestination newHttpDestination(Origin origin)
return new HttpDestinationOverHTTP(getHttpClient(), origin);
}
+ @Override
+ public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException
+ {
+ HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
+ @SuppressWarnings("unchecked")
+ Promise promise = (Promise)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
+ org.eclipse.jetty.io.Connection connection = newHttpConnection(endPoint, destination, promise);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Created {}", connection);
+ return customize(connection, context);
+ }
+
protected HttpConnectionOverHTTP newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise)
{
return new HttpConnectionOverHTTP(endPoint, destination, promise);
From d8d1ecf6a15b17e755c18da52b9527ebed869958 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Thu, 31 Jan 2019 09:39:21 +1000
Subject: [PATCH 24/35] use snapshot of maven-invoker-plugin because of NPE
https://issues.apache.org/jira/browse/MINVOKER-247
Signed-off-by: olivier lamy
---
pom.xml | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index cab78307d503..c24f66dd5892 100644
--- a/pom.xml
+++ b/pom.xml
@@ -490,7 +490,7 @@
org.apache.maven.plugins
maven-invoker-plugin
- 3.2.0
+ 3.2.1-SNAPSHOT
${it.debug}
${java.home}
@@ -1531,4 +1531,27 @@
+
+
+ apache.snapshots
+ https://repository.apache.org/content/repositories/snapshots
+
+ false
+
+
+ true
+
+
+
+ plexus-snapshots
+ https://oss.sonatype.org/content/repositories/plexus-snapshots
+
+ false
+
+
+ true
+
+
+
+
From b9281e323d4bb24507a82671212071f79f63ba6e Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Thu, 31 Jan 2019 09:50:07 +1000
Subject: [PATCH 25/35] fix merge
Signed-off-by: olivier lamy
---
pom.xml | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/pom.xml b/pom.xml
index c24f66dd5892..0cb3a5c74a5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,29 +13,6 @@
https://eclipse.org/jetty
1995
-
-
- apache.snapshots
- https://repository.apache.org/content/repositories/snapshots
-
- false
-
-
- true
-
-
-
- plexus-snapshots
- https://oss.sonatype.org/content/repositories/plexus-snapshots
-
- false
-
-
- true
-
-
-
-
11
11
From 0d89f29e1bf0a51010d033f4cd5f510c620f6e8d Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 29 Nov 2018 16:51:29 +0100
Subject: [PATCH 26/35] Issue #3162 - Use Jetty specific Servlet API jar.
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
to match the new Jetty Servlet API jar.
Signed-off-by: Simone Bordet
---
.../src/test/java/org/eclipse/jetty/jstl/JspConfig.java | 2 +-
jetty-server/src/main/config/modules/server.mod | 2 +-
jetty-servlets/pom.xml | 2 +-
pom.xml | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
index 773588a977e0..7e0ce3ad8ed1 100644
--- a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
+++ b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
@@ -33,7 +33,7 @@ public static void init(WebAppContext context, URI baseUri, File scratchDir)
{
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
+ ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
context.setWar(baseUri.toASCIIString());
context.setResourceBase(baseUri.toASCIIString());
}
diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod
index d10d42f2c8f8..3bb975f84fd5 100644
--- a/jetty-server/src/main/config/modules/server.mod
+++ b/jetty-server/src/main/config/modules/server.mod
@@ -13,7 +13,7 @@ logging
threadpool
[lib]
-lib/jetty-servlet-api-4.*.jar
+lib/jetty-servlet-api-4.0.*.jar
lib/jetty-http-${jetty.version}.jar
lib/jetty-server-${jetty.version}.jar
lib/jetty-xml-${jetty.version}.jar
diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml
index af52c98a4125..de246581f57a 100644
--- a/jetty-servlets/pom.xml
+++ b/jetty-servlets/pom.xml
@@ -24,7 +24,7 @@
@{argLine} ${jetty.surefire.argLine}
- --add-modules jetty..servlet.api
+ --add-modules jetty.servlet.api
--add-modules org.eclipse.jetty.util
--add-modules org.eclipse.jetty.io
--add-modules org.eclipse.jetty.http
diff --git a/pom.xml b/pom.xml
index 0cb3a5c74a5f..de2da048293b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
1.3.0-alpha4
5.1.1.RELEASE
1.2
- 4.0.1-SNAPSHOT
+ 4.0.1
9.0.14.1
undefined
@@ -903,7 +903,7 @@
org.eclipse.jetty.toolchain
jetty-servlet-api
- ${servlet.api.version}
+ ${servlet.api.version}
javax.websocket
From 66f8259df351a53b5b417b01f46bb6e86edc4ca9 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 29 Nov 2018 17:36:09 +0100
Subject: [PATCH 27/35] Issue #3162 - Use Jetty specific Servlet API jar.
Removed references to jetty-osgi-servlet-api.
Signed-off-by: Simone Bordet
---
.../org/eclipse/jetty/osgi/test/TestOSGiUtil.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index d7ddde5347f1..8b17f83e1d05 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -18,13 +18,6 @@
package org.eclipse.jetty.osgi.test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -51,6 +44,13 @@
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
/**
* Helper methods for pax-exam tests
*/
From 95bc15f52107d1d9bd24eb2d13a478c6f80bf0c4 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Fri, 30 Nov 2018 15:03:44 -0600
Subject: [PATCH 28/35] Issue #3162 - Correcting websocket issues in OSGi
Signed-off-by: Joakim Erdfelt
---
.../jetty/osgi/test/SimpleEchoSocket.java | 18 ++++++++----------
.../test/TestJettyOSGiBootWithWebSocket.java | 1 +
.../eclipse/jetty/osgi/test/TestOSGiUtil.java | 6 +++---
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
index 0629ca8600da..beeaec682f55 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
@@ -19,9 +19,10 @@
package org.eclipse.jetty.osgi.test;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
@@ -35,6 +36,7 @@
@WebSocket(maxTextMessageSize = 64 * 1024)
public class SimpleEchoSocket
{
+ private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
private final CountDownLatch closeLatch;
@SuppressWarnings("unused")
private Session session;
@@ -52,7 +54,8 @@ public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedExcepti
@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
- //System.out.printf("Connection closed: %d - %s%n",statusCode,reason);
+ LOG.debug("Connection closed: {} - {}", statusCode, reason);
+
this.session = null;
this.closeLatch.countDown(); // trigger latch
}
@@ -60,16 +63,11 @@ public void onClose(int statusCode, String reason)
@OnWebSocketConnect
public void onConnect(Session session)
{
- //System.out.printf("Got connect: %s%n",session);
+ LOG.debug("Got connect: {}", session);
this.session = session;
try
{
- Future fut;
- //System.err.println("Sending Foo!");
- fut = session.getRemote().sendStringByFuture("Foo");
-
- fut.get(2,TimeUnit.SECONDS); // wait for send to complete.
- //System.err.println("Foo complete");
+ session.getRemote().sendString("Foo");
session.close(StatusCode.NORMAL,"I'm done");
}
@@ -82,6 +80,6 @@ public void onConnect(Session session)
@OnWebSocketMessage
public void onMessage(String msg)
{
- //System.out.printf("Got msg: %s%n",msg);
+ LOG.debug("Got msg: {}", msg);
}
}
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
index 1f37b0b9a54d..bec6e8e326ed 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
@@ -55,6 +55,7 @@ public class TestJettyOSGiBootWithWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
+ options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 8b17f83e1d05..7a2ea65ef09b 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -56,7 +56,7 @@
*/
public class TestOSGiUtil
{
-
+
public static final String BUNDLE_DEBUG = "bundle.debug";
public static List configureJettyHomeAndPort(boolean ssl,String jettySelectorFileName)
@@ -99,13 +99,13 @@ public static List provisionCoreJetty()
res.addAll(coreJettyDependencies());
return res;
}
-
+
public static Option optionalRemoteDebug()
{
return CoreOptions.when(Boolean.getBoolean("pax.exam.debug.remote"))
.useOptions(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"));
}
-
+
public static List coreJettyDependencies()
{
List res = new ArrayList<>();
From e135197066bb8f8cca3b494f4f6cad526162876e Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 3 Dec 2018 17:35:08 -0600
Subject: [PATCH 29/35] Issue #3162 - Introducing more convenience Options for
PaxExam
Signed-off-by: Joakim Erdfelt
---
.../eclipse/jetty/osgi/test/TestOSGiUtil.java | 31 ++++++++++++++-----
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 7a2ea65ef09b..bf6687b322b4 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -18,6 +18,13 @@
package org.eclipse.jetty.osgi.test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -36,6 +43,7 @@
import org.eclipse.jetty.osgi.boot.OSGiServerConstants;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.util.log.StdErrLog;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
@@ -44,13 +52,6 @@
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
/**
* Helper methods for pax-exam tests
*/
@@ -283,6 +284,22 @@ protected static SslContextFactory newSslContextFactory()
return sslContextFactory;
}
+ public static List jettyLogging()
+ {
+ List options = new ArrayList<>();
+ // SLF4J Specific (possible set of options)
+ /*
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").versionAsInProject().start());
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("jul-to-slf4j").versionAsInProject().start());
+ options.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-log4j12").versionAsInProject().start());
+ options.add(mavenBundle().groupId("log4j").artifactId("log4j").versionAsInProject().start());
+ options.add(systemProperty("org.eclipse.jetty.util.log.class").value(Slf4jLog.class.getName()));
+ */
+ options.add(systemProperty("org.eclipse.jetty.util.log.class").value(StdErrLog.class.getName()));
+ options.add(systemProperty("org.eclipse.jetty.LEVEL").value("INFO"));
+ return options;
+ }
+
protected static void testHttpServiceGreetings(BundleContext bundleContext, String protocol, int port) throws Exception
{
assertActiveBundle(bundleContext, "org.eclipse.jetty.osgi.boot");
From 72ad74866ced52a417b667adb05f379bf5e228f0 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Wed, 30 Jan 2019 12:43:36 -0600
Subject: [PATCH 30/35] Issue #3162 - Reverting not-relevant OSGi changes
Signed-off-by: Joakim Erdfelt
---
.../jetty/osgi/test/SimpleEchoSocket.java | 18 ++++++++++--------
.../test/TestJettyOSGiBootWithWebSocket.java | 1 -
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
index beeaec682f55..0629ca8600da 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java
@@ -19,10 +19,9 @@
package org.eclipse.jetty.osgi.test;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
@@ -36,7 +35,6 @@
@WebSocket(maxTextMessageSize = 64 * 1024)
public class SimpleEchoSocket
{
- private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
private final CountDownLatch closeLatch;
@SuppressWarnings("unused")
private Session session;
@@ -54,8 +52,7 @@ public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedExcepti
@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
- LOG.debug("Connection closed: {} - {}", statusCode, reason);
-
+ //System.out.printf("Connection closed: %d - %s%n",statusCode,reason);
this.session = null;
this.closeLatch.countDown(); // trigger latch
}
@@ -63,11 +60,16 @@ public void onClose(int statusCode, String reason)
@OnWebSocketConnect
public void onConnect(Session session)
{
- LOG.debug("Got connect: {}", session);
+ //System.out.printf("Got connect: %s%n",session);
this.session = session;
try
{
- session.getRemote().sendString("Foo");
+ Future fut;
+ //System.err.println("Sending Foo!");
+ fut = session.getRemote().sendStringByFuture("Foo");
+
+ fut.get(2,TimeUnit.SECONDS); // wait for send to complete.
+ //System.err.println("Foo complete");
session.close(StatusCode.NORMAL,"I'm done");
}
@@ -80,6 +82,6 @@ public void onConnect(Session session)
@OnWebSocketMessage
public void onMessage(String msg)
{
- LOG.debug("Got msg: {}", msg);
+ //System.out.printf("Got msg: %s%n",msg);
}
}
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
index bec6e8e326ed..1f37b0b9a54d 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
@@ -55,7 +55,6 @@ public class TestJettyOSGiBootWithWebSocket
public static Option[] configure()
{
ArrayList options = new ArrayList<>();
- options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
From 33f314e9f5afd42d6a3f0e0a1e0fc2783406f428 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Mon, 4 Feb 2019 18:46:53 +0100
Subject: [PATCH 31/35] Issue #3162 - Use Jetty specific Servlet API jar.
Updated to jetty-servlet-api:4.0.1, based on javax.servlet 4.0.1.
Signed-off-by: Simone Bordet
---
jetty-home/pom.xml | 2 +-
jetty-maven-plugin/src/it/javax-annotation-api/pom.xml | 4 ++--
jetty-websocket/javax-websocket-client/pom.xml | 1 +
jetty-websocket/javax-websocket-common/pom.xml | 1 +
jetty-websocket/jetty-websocket-api/pom.xml | 1 +
jetty-websocket/jetty-websocket-client/pom.xml | 1 +
jetty-websocket/jetty-websocket-common/pom.xml | 1 +
jetty-websocket/jetty-websocket-tests/pom.xml | 1 +
jetty-websocket/websocket-servlet/pom.xml | 1 +
tests/test-webapps/test-proxy-webapp/pom.xml | 8 --------
10 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml
index 9583ed898908..1f7f7e2af9ad 100644
--- a/jetty-home/pom.xml
+++ b/jetty-home/pom.xml
@@ -302,7 +302,7 @@
copy-dependencies
- javax.servlet
+ org.eclipse.jetty.toolchain
jar
sources
${source-assembly-directory}/lib/servlet-api
diff --git a/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml b/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml
index 0bfdf53d6153..fb18c6c64270 100644
--- a/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml
+++ b/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml
@@ -24,8 +24,8 @@
- javax.servlet
- javax.servlet-api
+ org.eclipse.jetty.toolchain
+ jetty-servlet-api
@servlet.api.version@
provided
diff --git a/jetty-websocket/javax-websocket-client/pom.xml b/jetty-websocket/javax-websocket-client/pom.xml
index d5d6cfecdec1..3a9dfbda99f0 100644
--- a/jetty-websocket/javax-websocket-client/pom.xml
+++ b/jetty-websocket/javax-websocket-client/pom.xml
@@ -85,6 +85,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/javax-websocket-common/pom.xml b/jetty-websocket/javax-websocket-common/pom.xml
index 2273bae2d4d2..eee29af01222 100644
--- a/jetty-websocket/javax-websocket-common/pom.xml
+++ b/jetty-websocket/javax-websocket-common/pom.xml
@@ -56,6 +56,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/jetty-websocket-api/pom.xml b/jetty-websocket/jetty-websocket-api/pom.xml
index 8e03d98bfe8c..68c3da22e417 100644
--- a/jetty-websocket/jetty-websocket-api/pom.xml
+++ b/jetty-websocket/jetty-websocket-api/pom.xml
@@ -44,6 +44,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/jetty-websocket-client/pom.xml b/jetty-websocket/jetty-websocket-client/pom.xml
index 19e757f4cc0d..3b922fbb0be8 100644
--- a/jetty-websocket/jetty-websocket-client/pom.xml
+++ b/jetty-websocket/jetty-websocket-client/pom.xml
@@ -72,6 +72,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/jetty-websocket-common/pom.xml b/jetty-websocket/jetty-websocket-common/pom.xml
index 49d73ba77594..9d8eb9e37fe7 100644
--- a/jetty-websocket/jetty-websocket-common/pom.xml
+++ b/jetty-websocket/jetty-websocket-common/pom.xml
@@ -35,6 +35,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/jetty-websocket-tests/pom.xml b/jetty-websocket/jetty-websocket-tests/pom.xml
index 04ffd5cb1608..ed5b8ea0e61f 100644
--- a/jetty-websocket/jetty-websocket-tests/pom.xml
+++ b/jetty-websocket/jetty-websocket-tests/pom.xml
@@ -59,6 +59,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml
index f5a4b614ac56..ab1e55a83d45 100644
--- a/jetty-websocket/websocket-servlet/pom.xml
+++ b/jetty-websocket/websocket-servlet/pom.xml
@@ -87,6 +87,7 @@
org.eclipse.jetty.orbit:javax.servlet
org.mortbay.jetty:servlet-api
jetty:servlet-api
+ jetty-servlet-api
diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml
index 5dd0f619c08f..97800f44fa79 100644
--- a/tests/test-webapps/test-proxy-webapp/pom.xml
+++ b/tests/test-webapps/test-proxy-webapp/pom.xml
@@ -45,14 +45,6 @@
jetty-servlet-api
provided
-
-
org.eclipse.jetty
jetty-webapp
From 107170adf84844744d55d1b9ccadffed988905d4 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Mon, 4 Feb 2019 22:55:21 +0100
Subject: [PATCH 32/35] Issue #3162 - Use Jetty specific Servlet API jar.
Updated to jetty-servlet-api:4.0.2, based on jakarta.servlet 4.0.2.
Signed-off-by: Simone Bordet
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index de2da048293b..fb30a10e6f24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
1.3.0-alpha4
5.1.1.RELEASE
1.2
- 4.0.1
+ 4.0.2
9.0.14.1
undefined
From b09f1de035cb9d4f6b53ad42baf7f8d28f4d98d3 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 4 Feb 2019 19:32:00 -0600
Subject: [PATCH 33/35] Issue #3162 - Fixing compilation issues
---
.../src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java | 2 +-
.../org/eclipse/jetty/server/OptionalSslConnectionTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
index bff0dd69914a..d8fdacf6df00 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
@@ -432,7 +432,7 @@ public void upgrade(Connection newConnection)
if (LOG.isDebugEnabled())
LOG.debug("{} upgrading from {} to {} with {}",
- this, old_connection, newConnection, BufferUtil.toDetailString(prefilled));
+ this, old_connection, newConnection, BufferUtil.toDetailString(buffer));
if (newConnection instanceof Connection.UpgradeTo)
((Connection.UpgradeTo)newConnection).onUpgradeTo(buffer);
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/OptionalSslConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/OptionalSslConnectionTest.java
index 7a8e7a00e7e2..e1de577b548d 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/OptionalSslConnectionTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/OptionalSslConnectionTest.java
@@ -29,7 +29,7 @@
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus;
-import org.eclipse.jetty.http.HttpTester;
+import org.eclipse.jetty.http.tools.HttpTester;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.ssl.SslContextFactory;
From e4df1fe8af2b5cf0093371fc270df059c3ea86e1 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Mon, 4 Feb 2019 19:34:20 -0600
Subject: [PATCH 34/35] Issue #3162 - Correcting javadoc
---
.../src/main/asciidoc/development/maven/jetty-maven-plugin.adoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
index afb922613777..04d429418d34 100644
--- a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
+++ b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
@@ -324,7 +324,7 @@ Defaults to "true".
Controls whether any overlaid wars are added before or after the original base resource(s) of the webapp.
See the section on link:#using-overlaid-wars[overlaid wars] for more information.
containerIncludeJarPattern;;
-Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/[^/]*servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
+Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/jetty-servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
This is a pattern that is applied to the names of the jars on the container's classpath (ie the classpath of the plugin, not that of the webapp) that should be scanned for fragments, tlds, annotations etc.
This is analogous to the context attribute link:#container-include-jar-pattern[org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern] that is documented link:#container-include-jar-pattern[here].
You can define extra patterns of jars that will be included in the scan.
From 9286cdcf09e78b650974ef7b8599980b4d17715f Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 7 Feb 2019 13:08:26 +0100
Subject: [PATCH 35/35] Issue #3162 - Use Jetty specific Servlet API jar.
Updated references to Servlet jar to "jetty-servlet-api".
Signed-off-by: Simone Bordet
---
.../org/eclipse/jetty/jstl/JspConfig.java | 2 +-
.../eclipse/jetty/embedded/LikeJettyXml.java | 4 +--
.../jetty/embedded/OneWebAppWithJsp.java | 2 +-
.../jetty/embedded/ServerWithAnnotations.java | 2 +-
jetty-ant/src/test/config/build.xml | 2 +-
.../src/main/config/etc/jetty-deploy.xml | 2 +-
.../resources/jetty-deploymgr-contexts.xml | 2 +-
.../administration/logging/dump-tool.adoc | 30 +++++++++----------
.../session-configuration-infinispan.adoc | 4 +--
.../screen-http-webapp-deploy-listconfig.adoc | 2 +-
.../startup/screen-list-modules.adoc | 2 +-
.../startup/startup-base-vs-home.adoc | 2 +-
.../startup/startup-classpath.adoc | 2 +-
.../administration/startup/startup-jpms.adoc | 4 +--
.../startup/startup-overview.adoc | 6 ++--
.../security/jetty-home-and-jetty-base.adoc | 4 +--
.../development/maven/jetty-maven-plugin.adoc | 2 +-
.../maven/plugin/JettyWebAppContext.java | 2 +-
.../src/test/resources/RFC2616Base.xml | 2 +-
.../org/eclipse/jetty/test/jmx/JmxIT.java | 2 +-
.../java/org/eclipse/jetty/TestServer.java | 2 +-
.../test-spec-webapp/pom.xml | 2 +-
22 files changed, 41 insertions(+), 43 deletions(-)
diff --git a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
index 7e0ce3ad8ed1..226e5e2859fd 100644
--- a/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
+++ b/apache-jstl/src/test/java/org/eclipse/jetty/jstl/JspConfig.java
@@ -33,7 +33,7 @@ public static void init(WebAppContext context, URI baseUri, File scratchDir)
{
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
+ ".*/jetty-servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
context.setWar(baseUri.toASCIIString());
context.setResourceBase(baseUri.toASCIIString());
}
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java
index 0366390c2b2d..24983996eeb9 100644
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java
@@ -25,7 +25,6 @@
import org.eclipse.jetty.annotations.AnnotationConfiguration;
import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.deploy.PropertiesConfigurationManager;
-import org.eclipse.jetty.deploy.bindings.DebugListenerBinding;
import org.eclipse.jetty.deploy.providers.WebAppProvider;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.jmx.MBeanContainer;
@@ -35,7 +34,6 @@
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.server.AsyncRequestLogWriter;
import org.eclipse.jetty.server.CustomRequestLog;
-import org.eclipse.jetty.server.DebugListener;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
@@ -174,7 +172,7 @@ public static void main( String[] args ) throws Exception
deployer.setContexts(contexts);
deployer.setContextAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$");
+ ".*/jetty-servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$");
WebAppProvider webapp_provider = new WebAppProvider();
webapp_provider.setMonitoredDirName(jetty_base + "/webapps");
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebAppWithJsp.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebAppWithJsp.java
index 099cf27ddb21..39b11d70796c 100644
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebAppWithJsp.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebAppWithJsp.java
@@ -76,7 +76,7 @@ public static void main( String[] args ) throws Exception
// scan for them instead.
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$" );
+ ".*/jetty-servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$" );
// A WebAppContext is a ContextHandler as well so it needs to be set to
// the server so it is aware of where to
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
index 584616d0d3a7..d13cc003a122 100644
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
@@ -53,7 +53,7 @@ public static final void main( String args[] ) throws Exception
webapp.setWar(warFile.getAbsolutePath());
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$");
+ ".*/jetty-servlet-api-[^/]*\\.jar$");
server.setHandler(webapp);
// Register new transaction manager in JNDI
diff --git a/jetty-ant/src/test/config/build.xml b/jetty-ant/src/test/config/build.xml
index 49244b5df9ff..5e833b797a1f 100644
--- a/jetty-ant/src/test/config/build.xml
+++ b/jetty-ant/src/test/config/build.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/jetty-deploy/src/main/config/etc/jetty-deploy.xml b/jetty-deploy/src/main/config/etc/jetty-deploy.xml
index 35612573935f..5372d29b2cdc 100644
--- a/jetty-deploy/src/main/config/etc/jetty-deploy.xml
+++ b/jetty-deploy/src/main/config/etc/jetty-deploy.xml
@@ -18,7 +18,7 @@
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$
+ .*/jetty-servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$
diff --git a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
index 15f43f81210e..c5d3cd156d1f 100644
--- a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
+++ b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
@@ -11,7 +11,7 @@
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/[^/]*servlet-api-[^/]*\.jar$
+ .*/jetty-servlet-api-[^/]*\.jar$
diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/dump-tool.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/dump-tool.adoc
index 0f729e2e563e..adc31d3a6e41 100644
--- a/jetty-documentation/src/main/asciidoc/administration/logging/dump-tool.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/logging/dump-tool.adoc
@@ -225,7 +225,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | | | += jsp@19c47==org.apache.jasper.servlet.JspServlet,0,true - STARTED
| | | | | | | +- logVerbosityLevel=DEBUG
| | | | | | | +- fork=false
- | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
+ | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
| | | | | | | +- scratchdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/jsp
| | | | | | | +- xpoweredBy=false
| | | | | | +- [*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp
@@ -259,7 +259,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | +- file:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-util-ajax-{VERSION}.jar
| | | | +- startJarLoader@7194b34a
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar
- | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar
+ | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar
@@ -288,7 +288,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | +- sun.misc.Launcher$ExtClassLoader@1693b52b
| | | +> javax.servlet.context.tempdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-
| | | +> org.apache.catalina.jsp_classpath=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/classes:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/example-async-rest-jar-9.0.2.v20130417.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-client-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-http-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-io-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-util-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-async-rest.war-_async-rest-any-/webapp/WEB-INF/lib/jetty-util-ajax-{VERSION}.jar
- | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | | +> com.sun.jsp.taglibraryCache={}
| | | +> com.sun.jsp.tagFileJarUrlsCache={}
| | += o.e.j.s.h.MovedContextHandler@5e0c8d24{/oldContextPath,null,AVAILABLE} - STARTED
@@ -297,7 +297,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +~ org.eclipse.jetty.jmx.MBeanContainer@644a5ddd
| | | |
| | | +> No ClassLoader
- | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | += o.e.j.w.WebAppContext@6f01ba6f{/,file:/home/user/jetty-distribution-{VERSION}/webapps/ROOT/,AVAILABLE}{/ROOT} - STARTED
| | | += org.eclipse.jetty.server.session.SessionHandler@5a770658 - STARTED
| | | | += org.eclipse.jetty.server.session.HashSessionManager@746a95ae - STARTED
@@ -320,7 +320,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | | | += jsp@19c47==org.apache.jasper.servlet.JspServlet,0,true - STARTED
| | | | | | | +- logVerbosityLevel=DEBUG
| | | | | | | +- fork=false
- | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
+ | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
| | | | | | | +- scratchdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-ROOT-_-any-/jsp
| | | | | | | +- xpoweredBy=false
| | | | | | +- [*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp
@@ -343,7 +343,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +> WebAppClassLoader=ROOT@7af33249
| | | | +- startJarLoader@7194b34a
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar
- | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar
+ | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar
@@ -371,7 +371,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | +- file:/home/user/jetty-distribution-{VERSION}/start.jar
| | | | +- sun.misc.Launcher$ExtClassLoader@1693b52b
| | | +> javax.servlet.context.tempdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-ROOT-_-any-
- | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | | +> com.sun.jsp.taglibraryCache={}
| | | +> com.sun.jsp.tagFileJarUrlsCache={}
| | += o.e.j.s.h.ContextHandler@7b2dffdf{/javadoc,file:/home/user/jetty-distribution-{VERSION}/javadoc,AVAILABLE} - STARTED
@@ -380,7 +380,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +~ org.eclipse.jetty.jmx.MBeanContainer@644a5ddd
| | | |
| | | +> No ClassLoader
- | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | += o.e.j.w.WebAppContext@716d9094{/test,file:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/,AVAILABLE}{/test.war} - STARTED
| | | += org.eclipse.jetty.server.session.SessionHandler@336abd81 - STARTED
| | | | += org.eclipse.jetty.server.session.HashSessionManager@1246f8d0 - STARTED
@@ -403,7 +403,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | | | += jsp@19c47==org.apache.jasper.servlet.JspServlet,0,true - STARTED
| | | | | | | +- logVerbosityLevel=DEBUG
| | | | | | | +- fork=false
- | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
+ | | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
| | | | | | | +- scratchdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/jsp
| | | | | | | +- xpoweredBy=false
| | | | | | +- [*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp
@@ -495,7 +495,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | +- file:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/websocket-servlet-9.0.2.v20130417.jar
| | | | +- startJarLoader@7194b34a
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar
- | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar
+ | | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar
| | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar
@@ -526,7 +526,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +> context-override-example=a context value
| | | +> javax.servlet.context.tempdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-
| | | +> org.apache.catalina.jsp_classpath=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/classes:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/jetty-continuation-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/jetty-http-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/jetty-io-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/jetty-servlets-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/jetty-util-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/websocket-api-9.0.2.v20130417.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-test.war-_test-any-/webapp/WEB-INF/lib/websocket-servlet-9.0.2.v20130417.jar
- | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | | +> QoSFilter=org.eclipse.jetty.servlets.QoSFilter@6df3d1f5
| | | +> com.sun.jsp.taglibraryCache={}
| | | +> com.sun.jsp.tagFileJarUrlsCache={}
@@ -552,7 +552,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | | | += jsp@19c47==org.apache.jasper.servlet.JspServlet,0,true - STARTED
| | | | | | +- logVerbosityLevel=DEBUG
| | | | | | +- fork=false
- | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
+ | | | | | | +- com.sun.appserv.jsp.classpath=/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-security-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-webapp-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-deploy-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-client-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-jmx-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/com.sun.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.el-2.2.0.v201303151357.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/home/user/jetty-distribution-{VERSION}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar:/home/user/jetty-distribution-{VERSION}/resources:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-api-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-common-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-server-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/websocket/websocket-servlet-9.0.2.v20130417.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-util-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/lib/jetty-io-{VERSION}.jar:/home/user/jetty-distribution-{VERSION}/start.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/opt/local/lib/libsvnjavahl-1.0.dylib:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib:/System/Library/Java/Extensions/libJ3D.jnilib:/System/Library/Java/Extensions/libJ3DAudio.jnilib:/System/Library/Java/Extensions/libJ3DUtils.jnilib:/System/Library/Java/Extensions/libmlib_jai.jnilib:/System/Library/Java/Extensions/libQTJNative.jnilib:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/usr/lib/java/libjdns_sd.jnilib
| | | | | | +- scratchdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/jsp
| | | | | | +- xpoweredBy=false
| | | | | +- [*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp
@@ -589,7 +589,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +- file:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-util-{VERSION}.jar
| | | +- startJarLoader@7194b34a
| | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar
- | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar
+ | | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar
| | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar
| | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar
| | | +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar
@@ -618,7 +618,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
| | | +- sun.misc.Launcher$ExtClassLoader@1693b52b
| | +> javax.servlet.context.tempdir=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-
| | +> org.apache.catalina.jsp_classpath=/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/classes:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-client-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-http-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-io-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-proxy-{VERSION}.jar:/private/var/folders/br/kbs2g3753c54wmv4j31pnw5r0000gn/T/jetty-0.0.0.0-9090-xref-proxy.war-_xref-proxy-any-/webapp/WEB-INF/lib/jetty-util-{VERSION}.jar
- | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/servlet-api-[^/]*\.jar$
+ | | +> org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern=.*/jetty-servlet-api-[^/]*\.jar$
| | +> JavadocTransparentProxy.HttpClient=org.eclipse.jetty.client.HttpClient@580f016d
| | +> XrefTransparentProxy.HttpClient=org.eclipse.jetty.client.HttpClient@70c7e52b
| | +> com.sun.jsp.taglibraryCache={}
@@ -795,7 +795,7 @@ org.eclipse.jetty.server.Server@76f08fe1 - STARTING
|
+> startJarLoader@7194b34a
+- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-xml-{VERSION}.jar
- +- file:/home/user/jetty-distribution-{VERSION}/lib/servlet-api-3.0.jar
+ +- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-servlet-api-4.0.2.jar
+- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-http-{VERSION}.jar
+- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-continuation-{VERSION}.jar
+- file:/home/user/jetty-distribution-{VERSION}/lib/jetty-server-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-infinispan.adoc b/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-infinispan.adoc
index 8647aa9ce1c8..31b0e1f35fa2 100644
--- a/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-infinispan.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-infinispan.adoc
@@ -196,7 +196,7 @@ How to use the converter:
[source, screen, subs="{sub-order}"]
----
-java -cp servlet-api-3.1.jar:jetty-util-9.4.13.jar:jetty-server-9.4.13.jar:infinispan-remote-9.1.0.Final.jar:jetty-infinispan-9.4.13.jar:[other classpath] org.eclipse.jetty.session.infinispan.InfinispanSessionLegacyConverter
+java -cp jetty-servlet-api-4.0.2.jar:jetty-util-9.4.13.jar:jetty-server-9.4.13.jar:infinispan-remote-9.1.0.Final.jar:jetty-infinispan-9.4.13.jar:[other classpath] org.eclipse.jetty.session.infinispan.InfinispanSessionLegacyConverter
Usage: InfinispanSessionLegacyConverter [-Dhost=127.0.0.1] [-Dverbose=true|false] [check]
----
@@ -216,7 +216,7 @@ The following command will attempt to convert all sessions in the cached named `
[source, screen, subs="{sub-order}"]
----
-java -cp servlet-api-3.1.jar:jetty-util-9.4.13.jar:jetty-server-9.4.13.jar:infinispan-remote-9.1.0.Final.jar:jetty-infinispan-9.4.13.jar:/my/custom/classes org.eclipse.jetty.session.infinispan.InfinispanSessionLegacyConverter -Dhost=myhost my-remote-cache
+java -cp jetty-servlet-api-4.0.2.jar:jetty-util-9.4.13.jar:jetty-server-9.4.13.jar:infinispan-remote-9.1.0.Final.jar:jetty-infinispan-9.4.13.jar:/my/custom/classes org.eclipse.jetty.session.infinispan.InfinispanSessionLegacyConverter -Dhost=myhost my-remote-cache
----
If the converter fails to convert a session, an error message and stacktrace will be printed and the conversion will abort. The failed session should be untouched, however _it is prudent to take a backup of your cache before attempting the conversion_.
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
index 997c201485d6..e9e40f333b48 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc
@@ -65,7 +65,7 @@ Jetty Server Classpath:
Version Information on 11 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
- 0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
+ 0: 3.1.0 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
index 2ee7254fded0..b40e5dd7a3e4 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-list-modules.adoc
@@ -246,7 +246,7 @@ Modules for tag '*':
: Enables the core Jetty server on the classpath.
Depend: threadpool
Optional: jvm, ext, resources, logging
- LIB: lib/servlet-api-3.1.jar
+ LIB: lib/jetty-servlet-api-4.0.2.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
LIB: lib/jetty-xml-${jetty.version}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
index 268a785cf83d..650d7642f0d1 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-base-vs-home.adoc
@@ -158,7 +158,7 @@ Note: order presented here is how they would appear on the classpath.
1: 1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
- 4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
+ 4: 3.1.0 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
index 192f4de1d86b..5bfa599f6faa 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-classpath.adoc
@@ -68,7 +68,7 @@ Note: order presented here is how they would appear on the classpath.
1: 1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
- 4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
+ 4: 4.0.2 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
index 464b8ad4e946..25d5c379f4b7 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-jpms.adoc
@@ -69,7 +69,7 @@ This will give an output looking something like this (broken in sections for cla
[source, screen, subs="{sub-order}"]
....
/opt/openjdk-11+28/bin/java
---module-path /opt/jetty/lib/jetty-servlet-api-4.0.0.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
+--module-path /opt/jetty/lib/jetty-servlet-api-4.0.2.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
--module org.eclipse.jetty.xml/org.eclipse.jetty.xml.XmlConfiguration /opt/jetty/etc/jetty-threadpool.xml /opt/jetty/etc/jetty.xml ...
....
@@ -79,7 +79,7 @@ This list depends on the Jetty modules that have been enabled via the link:#star
The `--module` option tells the JVM to run main class `XmlConfiguration` from the `org.eclipse.jetty.xml` module, with the given XML files as program arguments.
When the JVM starts, module `org.eclipse.jetty.xml` is added to the set of JPMS _root modules_; all other Jetty modules, being automatic, will be resolved and added to the module graph.
-JAR files that are not modules, such as `servlet-api-3.1.jar`, are on the module-path and therefore will be made automatic modules by the JVM (hence the derived module name `servlet.api` for this jar, referenced by the `--patch-module` command line option above).
+JAR files that are not modules, such as `jetty-servlet-api-4.0.2.jar`, are on the module-path and therefore will be made automatic modules by the JVM (hence the derived module name `servlet.api` for this jar, referenced by the `--patch-module` command line option above).
[[jpms-advanced-config]]
==== Advanced JPMS Configuration
diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
index 956bea132ef6..d68351317729 100644
--- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-overview.adoc
@@ -103,7 +103,7 @@ Following the server dependency, the `${jetty.home}/modules/server.mod` file inc
....
[jetty-distribution-{VERSION}]$ cat modules/server.mod
[lib]
-lib/servlet-api-3.1.jar
+lib/jetty-servlet-api-4.0.2.jar
lib/jetty-http-${jetty.version}.jar
lib/jetty-server-${jetty.version}.jar
lib/jetty-xml-${jetty.version}.jar
@@ -162,7 +162,7 @@ Jetty Server Classpath:
Version Information on 7 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
- 0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
+ 0: 3.1.0 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
@@ -191,7 +191,7 @@ The following is the equivalent Java command line for what the `start.jar` boots
[jetty-distribution-{VERSION}]$ java -Djetty.home=$JETTY_HOME \
-Djetty.base=$JETTY_BASE \
-cp \
- $JETTY_HOME/lib/servlet-api-3.1.jar\
+ $JETTY_HOME/lib/jetty-servlet-api-4.0.2.jar\
:$JETTY_HOME/lib/jetty-http-$JETTY_VERSION.jar\
:$JETTY_HOME/lib/jetty-server-$JETTY_VERSION.jar \
:$JETTY_HOME/lib/jetty-xml-$JETTY_VERSION.jar\
diff --git a/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc b/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
index 5b549d471e8c..12ec92980526 100644
--- a/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
+++ b/jetty-documentation/src/main/asciidoc/configuring/security/jetty-home-and-jetty-base.adoc
@@ -209,7 +209,7 @@ Jetty Server Classpath:
Version Information on 11 entries in the classpath.
: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
- 0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
+ 0: 4.0.2 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
@@ -383,7 +383,7 @@ Module: security
depends: [server]
Module: server
- LIB: lib/servlet-api-3.1.jar
+ LIB: lib/jetty-servlet-api-4.0.2.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-continuation-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
diff --git a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
index 04d429418d34..b1b4610b5efd 100644
--- a/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
+++ b/jetty-documentation/src/main/asciidoc/development/maven/jetty-maven-plugin.adoc
@@ -324,7 +324,7 @@ Defaults to "true".
Controls whether any overlaid wars are added before or after the original base resource(s) of the webapp.
See the section on link:#using-overlaid-wars[overlaid wars] for more information.
containerIncludeJarPattern;;
-Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/jetty-servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
+Defaults to `.*/jetty-servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
This is a pattern that is applied to the names of the jars on the container's classpath (ie the classpath of the plugin, not that of the webapp) that should be scanned for fragments, tlds, annotations etc.
This is analogous to the context attribute link:#container-include-jar-pattern[org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern] that is documented link:#container-include-jar-pattern[here].
You can define extra patterns of jars that will be included in the scan.
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
index d4fe4c004132..a011f55a0baa 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
@@ -62,7 +62,7 @@ public class JettyWebAppContext extends WebAppContext
{
private static final Logger LOG = Log.getLogger(JettyWebAppContext.class);
- private static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar";
+ private static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/javax.servlet-[^/]*\\.jar$|.*/jetty-servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar";
private static final String WEB_INF_CLASSES_PREFIX = "/WEB-INF/classes";
diff --git a/tests/test-integration/src/test/resources/RFC2616Base.xml b/tests/test-integration/src/test/resources/RFC2616Base.xml
index 1724b9f72d2f..b04737485aae 100644
--- a/tests/test-integration/src/test/resources/RFC2616Base.xml
+++ b/tests/test-integration/src/test/resources/RFC2616Base.xml
@@ -80,7 +80,7 @@
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/[^/]*servlet-api-[^/]*\.jar$
+ .*/jetty-servlet-api-[^/]*\.jar$
diff --git a/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java b/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
index f14bf2715d2c..5d8162be7c3c 100644
--- a/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
+++ b/tests/test-jmx/jmx-webapp-it/src/test/java/org/eclipse/jetty/test/jmx/JmxIT.java
@@ -94,7 +94,7 @@ public void startJetty() throws Exception
context.addConfiguration(new AnnotationConfiguration());
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
- ".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$");
+ ".*/jetty-servlet-api-[^/]*\\.jar$");
_server.setHandler(context);
MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
diff --git a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java
index 35c1a54b6e17..ed8016b02fec 100644
--- a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java
+++ b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java
@@ -134,7 +134,7 @@ public static void main(String[] args) throws Exception
webapp.setResourceBase(jetty_root.resolve("tests/test-webapps/test-jetty-webapp/src/main/webapp").toString());
webapp.setAttribute(MetaInfConfiguration.CONTAINER_JAR_PATTERN,
".*/test-jetty-webapp/target/classes.*$|" +
- ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\\.jar$"
+ ".*/jetty-servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\\.jar$"
);
webapp.setAttribute("testAttribute","testValue");
diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
index e332c49d58e8..9943e6a4e933 100644
--- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
@@ -150,7 +150,7 @@
src/main/webapp
src/main/webapp/WEB-INF/web.xml
/test-spec
- .*/javax.servlet-[^/]*\.jar$
+ .*/jetty-servlet-api-[^/]*\.jar$
true
${basedir}/src/main/webapp/WEB-INF/jetty-env.xml