From 64655f7b7e049c0ed9dc6856d8e955f829fa027a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 3 Nov 2020 17:16:27 +1100
Subject: [PATCH 01/10] Issue #5320 - allow websocket client jars to be
provided by server
Signed-off-by: Lachlan Roberts
---
jetty-home/pom.xml | 5 +++++
.../src/main/config/modules/websocket.mod | 11 -----------
.../src/main/config/modules/websocket.mod | 11 -----------
.../src/main/config/modules/websocket-jetty.mod | 1 +
4 files changed, 6 insertions(+), 22 deletions(-)
delete mode 100644 jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod
delete mode 100644 jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml
index c9a6ef5207b7..c98483bed258 100644
--- a/jetty-home/pom.xml
+++ b/jetty-home/pom.xml
@@ -655,6 +655,11 @@
websocket-jetty-server
${project.version}
+
+ org.eclipse.jetty.websocket
+ websocket-jetty-client
+ ${project.version}
+
org.eclipse.jetty.websocket
websocket-javax-server
diff --git a/jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod b/jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod
deleted file mode 100644
index bc693b7e3d1a..000000000000
--- a/jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod
+++ /dev/null
@@ -1,11 +0,0 @@
-# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
-
-[description]
-Enables both Jetty and javax websocket modules for deployed web applications.
-
-[tags]
-websocket
-
-[depend]
-websocket-jetty
-websocket-javax
diff --git a/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod b/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod
deleted file mode 100644
index 97974ff6319e..000000000000
--- a/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod
+++ /dev/null
@@ -1,11 +0,0 @@
-# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
-
-[description]
-Enable both Jetty and javax websocket modules for deployed web applications.
-
-[tags]
-websocket
-
-[depend]
-websocket-jetty
-websocket-javax
diff --git a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
index 5c24a906fb5a..d2992fd2bac0 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
+++ b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
@@ -18,6 +18,7 @@ lib/websocket/websocket-util-${jetty.version}.jar
lib/websocket/websocket-util-server-${jetty.version}.jar
lib/websocket/websocket-jetty-api-${jetty.version}.jar
lib/websocket/websocket-jetty-common-${jetty.version}.jar
+lib/websocket/websocket-jetty-client-${jetty.version}.jar
lib/websocket/websocket-jetty-server-${jetty.version}.jar
[jpms]
From 8d21bb7b6359e3519003cfa188c2aa59109f9229 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 3 Nov 2020 17:17:27 +1100
Subject: [PATCH 02/10] Issue #5320 - fix the XmlHttpClientProvider for jetty
10, re-enable tests
Signed-off-by: Lachlan Roberts
---
.../core/client/HttpClientProvider.java | 16 ++++----------
.../core/client/XmlHttpClientProvider.java | 21 ++++++++++++++++---
.../tests/distribution/DistributionTests.java | 11 +++++-----
.../pom.xml | 9 ++++++++
.../test-websocket-client-webapp/pom.xml | 9 ++++++++
5 files changed, 46 insertions(+), 20 deletions(-)
diff --git a/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
index 194cddab347d..935e768482e9 100644
--- a/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
+++ b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
@@ -20,23 +20,15 @@
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.slf4j.LoggerFactory;
public interface HttpClientProvider
{
static HttpClient get()
{
- try
- {
- HttpClientProvider xmlProvider = new XmlHttpClientProvider();
- HttpClient client = xmlProvider.newHttpClient();
- if (client != null)
- return client;
- }
- catch (Throwable x)
- {
- LoggerFactory.getLogger(HttpClientProvider.class).trace("IGNORED", x);
- }
+ HttpClientProvider xmlProvider = new XmlHttpClientProvider();
+ HttpClient client = xmlProvider.newHttpClient();
+ if (client != null)
+ return client;
return HttpClientProvider.newDefaultHttpClient();
}
diff --git a/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
index 266613853000..af9962bc3d36 100644
--- a/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
+++ b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
@@ -33,12 +33,27 @@ class XmlHttpClientProvider implements HttpClientProvider
@Override
public HttpClient newHttpClient()
{
- URL resource = Thread.currentThread().getContextClassLoader().getResource("jetty-websocket-httpclient.xml");
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if (contextClassLoader == null)
+ return null;
+
+ URL resource = contextClassLoader.getResource("jetty-websocket-httpclient.xml");
if (resource == null)
- {
return null;
+
+ try
+ {
+ Thread.currentThread().setContextClassLoader(HttpClient.class.getClassLoader());
+ return newHttpClient(resource);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(contextClassLoader);
}
+ }
+ private static HttpClient newHttpClient(URL resource)
+ {
try
{
XmlConfiguration configuration = new XmlConfiguration(Resource.newResource(resource));
@@ -46,7 +61,7 @@ public HttpClient newHttpClient()
}
catch (Throwable t)
{
- LOG.warn("Unable to load: {}", resource, t);
+ LOG.warn("Failure to load HttpClient from XML {}", resource, t);
}
return null;
diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
index 64ae2dc689b6..df36ee106a24 100644
--- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
+++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
@@ -47,7 +47,6 @@
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.WebSocketListener;
import org.eclipse.jetty.websocket.client.WebSocketClient;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -376,7 +375,6 @@ public void testLog4j2ModuleWithSimpleWebAppWithJSP() throws Exception
}
}
- @Disabled
@ParameterizedTest
@ValueSource(strings = {"http", "https"})
public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Exception
@@ -389,11 +387,12 @@ public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Ex
.mavenLocalRepository(System.getProperty("mavenRepoPath"))
.build();
+ String module = "https".equals(scheme) ? "test-keystore," + scheme : scheme;
String[] args1 = {
"--create-startd",
"--approve-all-licenses",
- "--add-to-start=resources,server,webapp,deploy,jsp,jmx,servlet,servlets,websocket,test-keystore," + scheme
- };
+ "--add-to-start=resources,server,webapp,deploy,jsp,jmx,servlet,servlets,websocket," + module,
+ };
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
@@ -406,6 +405,9 @@ public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Ex
String[] args2 = {
"jetty.http.port=" + port,
"jetty.ssl.port=" + port,
+ // We need to expose the websocket client classes to the webapp for this to work.
+ "jetty.webapp.addServerClasses+=,-org.eclipse.jetty.websocket.client.",
+ "jetty.webapp.addSystemClasses+=,+org.eclipse.jetty.websocket.client.",
// "jetty.server.dumpAfterStart=true",
};
@@ -425,7 +427,6 @@ public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Ex
}
}
- @Disabled
@ParameterizedTest
@ValueSource(strings = {"http", "https"})
public void testWebsocketClientInWebapp(String scheme) throws Exception
diff --git a/tests/test-webapps/test-websocket-client-provided-webapp/pom.xml b/tests/test-webapps/test-websocket-client-provided-webapp/pom.xml
index 1ba112c51714..bcbf1c1e5415 100644
--- a/tests/test-webapps/test-websocket-client-provided-webapp/pom.xml
+++ b/tests/test-webapps/test-websocket-client-provided-webapp/pom.xml
@@ -13,6 +13,15 @@
Test :: Jetty Websocket Simple Webapp with WebSocketClient
+
+ org.slf4j
+ slf4j-api
+
+
+ org.eclipse.jetty
+ jetty-slf4j-impl
+ compile
+
org.eclipse.jetty.toolchain
jetty-servlet-api
diff --git a/tests/test-webapps/test-websocket-client-webapp/pom.xml b/tests/test-webapps/test-websocket-client-webapp/pom.xml
index 92f0054a2a53..3893cd7a350c 100644
--- a/tests/test-webapps/test-websocket-client-webapp/pom.xml
+++ b/tests/test-webapps/test-websocket-client-webapp/pom.xml
@@ -13,6 +13,15 @@
Test :: Jetty Websocket Simple Webapp with WebSocketClient
+
+ org.slf4j
+ slf4j-api
+
+
+ org.eclipse.jetty
+ jetty-slf4j-impl
+ compile
+
org.eclipse.jetty.toolchain
jetty-servlet-api
From fc4e263f93a12e1538e5a883533724b26d0944a7 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 4 Nov 2020 22:22:13 +1100
Subject: [PATCH 03/10] Add module and configuration for websocket-client
provided to webapp.
Signed-off-by: Lachlan Roberts
---
.../websocket-jetty-client/pom.xml | 6 ++
.../config/modules/websocket-jetty-client.mod | 24 ++++++
.../src/main/java/module-info.java | 1 +
.../JettyWebSocketClientConfiguration.java | 83 +++++++++++++++++++
.../org.eclipse.jetty.webapp.Configuration | 1 +
.../main/config/modules/websocket-jetty.mod | 3 -
.../config/JettyWebSocketConfiguration.java | 2 +-
.../tests/distribution/DistributionTests.java | 5 +-
8 files changed, 117 insertions(+), 8 deletions(-)
create mode 100644 jetty-websocket/websocket-jetty-client/src/main/config/modules/websocket-jetty-client.mod
create mode 100644 jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
create mode 100644 jetty-websocket/websocket-jetty-client/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
diff --git a/jetty-websocket/websocket-jetty-client/pom.xml b/jetty-websocket/websocket-jetty-client/pom.xml
index cc3c39db8324..c4226c69b7bd 100644
--- a/jetty-websocket/websocket-jetty-client/pom.xml
+++ b/jetty-websocket/websocket-jetty-client/pom.xml
@@ -35,6 +35,12 @@
jetty-client
${project.version}
+
+ org.eclipse.jetty
+ jetty-webapp
+ ${project.version}
+ true
+
org.slf4j
slf4j-api
diff --git a/jetty-websocket/websocket-jetty-client/src/main/config/modules/websocket-jetty-client.mod b/jetty-websocket/websocket-jetty-client/src/main/config/modules/websocket-jetty-client.mod
new file mode 100644
index 000000000000..0e35bf32ce45
--- /dev/null
+++ b/jetty-websocket/websocket-jetty-client/src/main/config/modules/websocket-jetty-client.mod
@@ -0,0 +1,24 @@
+# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
+[description]
+Expose the Jetty WebSocket Client classes to deployed web applications.
+
+[tags]
+websocket
+
+[depend]
+client
+annotations
+
+[lib]
+lib/websocket/websocket-core-common-${jetty.version}.jar
+lib/websocket/websocket-core-client-${jetty.version}.jar
+lib/websocket/websocket-util-${jetty.version}.jar
+lib/websocket/websocket-jetty-api-${jetty.version}.jar
+lib/websocket/websocket-jetty-common-${jetty.version}.jar
+lib/websocket/websocket-jetty-client-${jetty.version}.jar
+
+[jpms]
+# The implementation needs to access method handles in
+# classes that are in the web application classloader.
+add-reads: org.eclipse.jetty.websocket.jetty.common=ALL-UNNAMED
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
index 27c6f8600c36..9481ff8b0c34 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
@@ -20,6 +20,7 @@
{
exports org.eclipse.jetty.websocket.client;
+ requires static org.eclipse.jetty.webapp;
requires org.eclipse.jetty.websocket.core.client;
requires org.eclipse.jetty.websocket.jetty.common;
requires org.slf4j;
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
new file mode 100644
index 000000000000..7fd646d74133
--- /dev/null
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -0,0 +1,83 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.websocket.client.config;
+
+import java.util.ServiceLoader;
+
+import org.eclipse.jetty.util.Loader;
+import org.eclipse.jetty.webapp.AbstractConfiguration;
+import org.eclipse.jetty.webapp.Configuration;
+import org.eclipse.jetty.webapp.FragmentConfiguration;
+import org.eclipse.jetty.webapp.MetaInfConfiguration;
+import org.eclipse.jetty.webapp.WebAppConfiguration;
+import org.eclipse.jetty.webapp.WebInfConfiguration;
+import org.eclipse.jetty.webapp.WebXmlConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Websocket Configuration
+ * This configuration configures the WebAppContext server/system classes to
+ * be able to see the org.eclipse.jetty.websocket package.
+ * This class is defined in the webapp package, as it implements the {@link Configuration} interface,
+ * which is unknown to the websocket package. However, the corresponding {@link ServiceLoader}
+ * resource is defined in the websocket package, so that this configuration only be
+ * loaded if the jetty-websocket jars are on the classpath.
+ *
+ */
+public class JettyWebSocketClientConfiguration extends AbstractConfiguration
+{
+ private static final Logger LOG = LoggerFactory.getLogger(JettyWebSocketClientConfiguration.class);
+
+ public JettyWebSocketClientConfiguration()
+ {
+ addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
+
+ 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.");
+ protectAndExpose("org.eclipse.jetty.websocket.client.");
+ hide("org.eclipse.jetty.client.impl.");
+ hide("org.eclipse.jetty.client.config.");
+ }
+
+ @Override
+ public boolean isAvailable()
+ {
+ return isAvailable("org.eclipse.jetty.websocket.client.WebSocketClient");
+ }
+
+ private boolean isAvailable(String classname)
+ {
+ try
+ {
+ return Loader.loadClass(classname) != null;
+ }
+ catch (Throwable e)
+ {
+ LOG.trace("IGNORED", e);
+ return false;
+ }
+ }
+}
diff --git a/jetty-websocket/websocket-jetty-client/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-websocket/websocket-jetty-client/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
new file mode 100644
index 000000000000..376b7dbf6edc
--- /dev/null
+++ b/jetty-websocket/websocket-jetty-client/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
@@ -0,0 +1 @@
+org.eclipse.jetty.websocket.client.config.JettyWebSocketClientConfiguration
\ No newline at end of file
diff --git a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
index d2992fd2bac0..8194e1e74889 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
+++ b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
@@ -7,18 +7,15 @@ Enable the Jetty WebSocket API for deployed web applications.
websocket
[depend]
-client
annotations
[lib]
lib/websocket/websocket-core-common-${jetty.version}.jar
-lib/websocket/websocket-core-client-${jetty.version}.jar
lib/websocket/websocket-core-server-${jetty.version}.jar
lib/websocket/websocket-util-${jetty.version}.jar
lib/websocket/websocket-util-server-${jetty.version}.jar
lib/websocket/websocket-jetty-api-${jetty.version}.jar
lib/websocket/websocket-jetty-common-${jetty.version}.jar
-lib/websocket/websocket-jetty-client-${jetty.version}.jar
lib/websocket/websocket-jetty-server-${jetty.version}.jar
[jpms]
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index a2caa2480b28..7336c06232cc 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -68,7 +68,7 @@ else if (isAvailable("org.eclipse.jetty.annotations.AnnotationConfiguration"))
@Override
public boolean isAvailable()
{
- return isAvailable("org.eclipse.jetty.websocket.common.JettyWebSocketFrame");
+ return isAvailable("org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer");
}
private boolean isAvailable(String classname)
diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
index df36ee106a24..ad83995aa408 100644
--- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
+++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
@@ -391,7 +391,7 @@ public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Ex
String[] args1 = {
"--create-startd",
"--approve-all-licenses",
- "--add-to-start=resources,server,webapp,deploy,jsp,jmx,servlet,servlets,websocket," + module,
+ "--add-to-start=resources,server,webapp,deploy,jsp,jmx,servlet,servlets,websocket,websocket-jetty-client," + module,
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
@@ -405,9 +405,6 @@ public void testWebsocketClientInWebappProvidedByServer(String scheme) throws Ex
String[] args2 = {
"jetty.http.port=" + port,
"jetty.ssl.port=" + port,
- // We need to expose the websocket client classes to the webapp for this to work.
- "jetty.webapp.addServerClasses+=,-org.eclipse.jetty.websocket.client.",
- "jetty.webapp.addSystemClasses+=,+org.eclipse.jetty.websocket.client.",
// "jetty.server.dumpAfterStart=true",
};
From 416579a690e1b2d2ce5e3cd446957127ff58fcd5 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 4 Nov 2020 22:24:19 +1100
Subject: [PATCH 04/10] fix formatting in DistributionTests
Signed-off-by: Lachlan Roberts
---
.../jetty/tests/distribution/DistributionTests.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
index ad83995aa408..cd84e13f3972 100644
--- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
+++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java
@@ -128,7 +128,7 @@ public void testQuickStartGenerationAndRun() throws Exception
Path quickstartWebXml = webInf.resolve("quickstart-web.xml");
assertTrue(Files.exists(quickstartWebXml));
assertNotEquals(0, Files.size(quickstartWebXml));
-
+
int port = distribution.freePort();
try (JettyHomeTester.Run run3 = distribution.start("jetty.http.port=" + port, "jetty.quickstart.mode=QUICKSTART"))
@@ -144,7 +144,7 @@ public void testQuickStartGenerationAndRun() throws Exception
}
}
}
-
+
@Test
public void testSimpleWebAppWithJSP() throws Exception
{
@@ -455,7 +455,7 @@ public void testWebsocketClientInWebapp(String scheme) throws Exception
"jetty.http.port=" + port,
"jetty.ssl.port=" + port,
// "jetty.server.dumpAfterStart=true",
- };
+ };
try (JettyHomeTester.Run run2 = distribution.start(args2))
{
@@ -513,8 +513,8 @@ public void testWebAppWithProxyAndJPMS() throws Exception
/**
* This reproduces some classloading issue with MethodHandles in JDK14-15, this has been fixed in JDK16.
- * @see JDK-8244090
* @throws Exception if there is an error during the test.
+ * @see JDK-8244090
*/
@ParameterizedTest
@ValueSource(strings = {"", "--jpms"})
@@ -639,5 +639,4 @@ public void testStartStopLog4j2Modules() throws Exception
}
}
}
-
}
From fa1914a5b13029aac3a009e7028efa2123aff14a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Fri, 6 Nov 2020 19:03:52 +1100
Subject: [PATCH 05/10] Update Jetty WebSocketConfiguration classes
Signed-off-by: Lachlan Roberts
---
.../client/config/JettyWebSocketClientConfiguration.java | 5 ++---
.../server/config/JettyWebSocketConfiguration.java | 6 +++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
index 7fd646d74133..d6751bf8a639 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -20,7 +20,6 @@
import java.util.ServiceLoader;
-import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -34,7 +33,7 @@
/**
* Websocket Configuration
* This configuration configures the WebAppContext server/system classes to
- * be able to see the org.eclipse.jetty.websocket package.
+ * be able to see the {@code org.eclipse.jetty.websocket.client} package.
* This class is defined in the webapp package, as it implements the {@link Configuration} interface,
* which is unknown to the websocket package. However, the corresponding {@link ServiceLoader}
* resource is defined in the websocket package, so that this configuration only be
@@ -72,7 +71,7 @@ private boolean isAvailable(String classname)
{
try
{
- return Loader.loadClass(classname) != null;
+ return JettyWebSocketClientConfiguration.class.getClassLoader().loadClass(classname) != null;
}
catch (Throwable e)
{
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index 7336c06232cc..a9298485aa17 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -20,7 +20,6 @@
import java.util.ServiceLoader;
-import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -34,7 +33,8 @@
/**
*
Websocket Configuration
* This configuration configures the WebAppContext server/system classes to
- * be able to see the org.eclipse.jetty.websocket package.
+ * be able to see the {@code org.eclipse.jetty.websocket.api}, {@code org.eclipse.jetty.websocket.server} and
+ * {@code org.eclipse.jetty.websocket.util.server} packages.
* This class is defined in the webapp package, as it implements the {@link Configuration} interface,
* which is unknown to the websocket package. However, the corresponding {@link ServiceLoader}
* resource is defined in the websocket package, so that this configuration only be
@@ -75,7 +75,7 @@ private boolean isAvailable(String classname)
{
try
{
- return Loader.loadClass(classname) != null;
+ return JettyWebSocketConfiguration.class.getClassLoader().loadClass(classname) != null;
}
catch (Throwable e)
{
From 32433b10ad9944bcf8e7224e16a9026655d219ba Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Mon, 9 Nov 2020 18:12:50 +1100
Subject: [PATCH 06/10] revert change to the classloader used in isAvailable
Signed-off-by: Lachlan Roberts
---
.../client/config/JettyWebSocketClientConfiguration.java | 3 ++-
.../websocket/server/config/JettyWebSocketConfiguration.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
index d6751bf8a639..6e7e2a2346b1 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -20,6 +20,7 @@
import java.util.ServiceLoader;
+import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -71,7 +72,7 @@ private boolean isAvailable(String classname)
{
try
{
- return JettyWebSocketClientConfiguration.class.getClassLoader().loadClass(classname) != null;
+ return Loader.loadClass(classname) != null;
}
catch (Throwable e)
{
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index a9298485aa17..43920f6f6b3b 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -20,6 +20,7 @@
import java.util.ServiceLoader;
+import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -75,7 +76,7 @@ private boolean isAvailable(String classname)
{
try
{
- return JettyWebSocketConfiguration.class.getClassLoader().loadClass(classname) != null;
+ return Loader.loadClass(classname) != null;
}
catch (Throwable e)
{
From b6688c0267ff4a046e0cad1100d0c8e38fab5e3f Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Mon, 9 Nov 2020 23:17:30 +1100
Subject: [PATCH 07/10] Issue #5320 - changes from review
Signed-off-by: Lachlan Roberts
---
.../JettyWebSocketClientConfiguration.java | 21 ++++--------
.../config/JettyWebSocketConfiguration.java | 33 +++++++------------
2 files changed, 17 insertions(+), 37 deletions(-)
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
index 6e7e2a2346b1..b0527b9de7aa 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -20,7 +20,6 @@
import java.util.ServiceLoader;
-import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -48,13 +47,8 @@ public class JettyWebSocketClientConfiguration extends AbstractConfiguration
public JettyWebSocketClientConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
-
- 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)");
+ addDependents("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+ addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
protectAndExpose("org.eclipse.jetty.websocket.api.");
protectAndExpose("org.eclipse.jetty.websocket.client.");
@@ -64,20 +58,17 @@ else if (isAvailable("org.eclipse.jetty.annotations.AnnotationConfiguration"))
@Override
public boolean isAvailable()
- {
- return isAvailable("org.eclipse.jetty.websocket.client.WebSocketClient");
- }
-
- private boolean isAvailable(String classname)
{
try
{
- return Loader.loadClass(classname) != null;
+ ClassLoader classLoader = JettyWebSocketClientConfiguration.class.getClassLoader();
+ return classLoader.loadClass("org.eclipse.jetty.websocket.client.WebSocketClient") != null;
}
catch (Throwable e)
{
LOG.trace("IGNORED", e);
- return false;
}
+
+ return false;
}
}
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index 43920f6f6b3b..30e1787a5403 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -20,7 +20,6 @@
import java.util.ServiceLoader;
-import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
@@ -49,39 +48,29 @@ public class JettyWebSocketConfiguration extends AbstractConfiguration
public JettyWebSocketConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
+ addDependents("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+ 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.server.",
- "org.eclipse.jetty.websocket.util.server."); // For WebSocketUpgradeFilter
-
- hide("org.eclipse.jetty.server.internal.",
- "org.eclipse.jetty.server.config.");
+ protectAndExpose("org.eclipse.jetty.websocket.api.");
+ protectAndExpose("org.eclipse.jetty.websocket.server.");
+ protectAndExpose("org.eclipse.jetty.websocket.util.server."); // For WebSocketUpgradeFilter
+ hide("org.eclipse.jetty.server.internal.");
+ hide("org.eclipse.jetty.server.config.");
}
@Override
public boolean isAvailable()
- {
- return isAvailable("org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer");
- }
-
- private boolean isAvailable(String classname)
{
try
{
- return Loader.loadClass(classname) != null;
+ ClassLoader classLoader = JettyWebSocketConfiguration.class.getClassLoader();
+ return classLoader.loadClass("org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer") != null;
}
catch (Throwable e)
{
LOG.trace("IGNORED", e);
- return false;
}
+
+ return false;
}
}
From e842c16bb44837b0664e6e34a4460364c2eb03ac Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 10 Nov 2020 00:55:01 +1100
Subject: [PATCH 08/10] osgi AnnotationConfiguration should replace the
standard one
Signed-off-by: Lachlan Roberts
---
.../jetty/osgi/annotations/AnnotationConfiguration.java | 7 +++++++
1 file changed, 7 insertions(+)
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 8db88e052e85..b303f9fba118 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
@@ -30,6 +30,7 @@
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.statistic.CounterStatistic;
+import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
@@ -74,6 +75,12 @@ public AnnotationConfiguration()
{
}
+ @Override
+ public Class extends Configuration> replaces()
+ {
+ return org.eclipse.jetty.annotations.AnnotationConfiguration.class;
+ }
+
/**
* This parser scans the bundles using the OSGi APIs instead of assuming a jar.
*/
From 42ebdc1bc386fbb68a65d179a8b8d24816c376ef Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 10 Nov 2020 01:44:12 +1100
Subject: [PATCH 09/10] Issue #5320 - changes from review
Signed-off-by: Lachlan Roberts
---
.../JettyWebSocketClientConfiguration.java | 17 -----------------
.../config/JettyWebSocketConfiguration.java | 17 -----------------
2 files changed, 34 deletions(-)
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
index b0527b9de7aa..62537d15f421 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -47,7 +47,6 @@ public class JettyWebSocketClientConfiguration extends AbstractConfiguration
public JettyWebSocketClientConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
- addDependents("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
protectAndExpose("org.eclipse.jetty.websocket.api.");
@@ -55,20 +54,4 @@ public JettyWebSocketClientConfiguration()
hide("org.eclipse.jetty.client.impl.");
hide("org.eclipse.jetty.client.config.");
}
-
- @Override
- public boolean isAvailable()
- {
- try
- {
- ClassLoader classLoader = JettyWebSocketClientConfiguration.class.getClassLoader();
- return classLoader.loadClass("org.eclipse.jetty.websocket.client.WebSocketClient") != null;
- }
- catch (Throwable e)
- {
- LOG.trace("IGNORED", e);
- }
-
- return false;
- }
}
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index 30e1787a5403..3490ef65f211 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -48,7 +48,6 @@ public class JettyWebSocketConfiguration extends AbstractConfiguration
public JettyWebSocketConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
- addDependents("org.eclipse.jetty.osgi.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
protectAndExpose("org.eclipse.jetty.websocket.api.");
@@ -57,20 +56,4 @@ public JettyWebSocketConfiguration()
hide("org.eclipse.jetty.server.internal.");
hide("org.eclipse.jetty.server.config.");
}
-
- @Override
- public boolean isAvailable()
- {
- try
- {
- ClassLoader classLoader = JettyWebSocketConfiguration.class.getClassLoader();
- return classLoader.loadClass("org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer") != null;
- }
- catch (Throwable e)
- {
- LOG.trace("IGNORED", e);
- }
-
- return false;
- }
}
From a4160c4b5ef17f1c219f835615236ce546a274be Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Thu, 12 Nov 2020 09:47:38 +1100
Subject: [PATCH 10/10] Fix javadoc on websocket configuration classes.
Signed-off-by: Lachlan Roberts
---
.../server/config/JavaxWebSocketConfiguration.java | 4 ++--
.../config/JettyWebSocketClientConfiguration.java | 10 +---------
.../server/config/JettyWebSocketConfiguration.java | 10 +---------
3 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketConfiguration.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketConfiguration.java
index 6075eeb66e34..a6ab2692f04e 100644
--- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketConfiguration.java
@@ -28,8 +28,7 @@
/**
* Websocket Configuration
* This configuration configures the WebAppContext server/system classes to
- * be able to see the org.eclipse.jetty.websocket package.
- *
+ * be able to see the {@code org.eclipse.jetty.websocket.javax} packages.
*/
public class JavaxWebSocketConfiguration extends AbstractConfiguration
{
@@ -37,6 +36,7 @@ public JavaxWebSocketConfiguration()
{
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
+
protectAndExpose("org.eclipse.jetty.websocket.util.server."); // For WebSocketUpgradeFilter
protectAndExpose("org.eclipse.jetty.websocket.javax.server.config.");
protectAndExpose("org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainerProvider");
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
index 62537d15f421..ec754ec93174 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java
@@ -18,10 +18,7 @@
package org.eclipse.jetty.websocket.client.config;
-import java.util.ServiceLoader;
-
import org.eclipse.jetty.webapp.AbstractConfiguration;
-import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
import org.eclipse.jetty.webapp.MetaInfConfiguration;
import org.eclipse.jetty.webapp.WebAppConfiguration;
@@ -33,12 +30,7 @@
/**
* Websocket Configuration
* This configuration configures the WebAppContext server/system classes to
- * be able to see the {@code org.eclipse.jetty.websocket.client} package.
- * This class is defined in the webapp package, as it implements the {@link Configuration} interface,
- * which is unknown to the websocket package. However, the corresponding {@link ServiceLoader}
- * resource is defined in the websocket package, so that this configuration only be
- * loaded if the jetty-websocket jars are on the classpath.
- *
+ * be able to see the {@code org.eclipse.jetty.websocket.client} package.
*/
public class JettyWebSocketClientConfiguration extends AbstractConfiguration
{
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
index 3490ef65f211..5115c0005e0c 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java
@@ -18,10 +18,7 @@
package org.eclipse.jetty.websocket.server.config;
-import java.util.ServiceLoader;
-
import org.eclipse.jetty.webapp.AbstractConfiguration;
-import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
import org.eclipse.jetty.webapp.MetaInfConfiguration;
import org.eclipse.jetty.webapp.WebAppConfiguration;
@@ -34,12 +31,7 @@
* Websocket Configuration
* This configuration configures the WebAppContext server/system classes to
* be able to see the {@code org.eclipse.jetty.websocket.api}, {@code org.eclipse.jetty.websocket.server} and
- * {@code org.eclipse.jetty.websocket.util.server} packages.
- * This class is defined in the webapp package, as it implements the {@link Configuration} interface,
- * which is unknown to the websocket package. However, the corresponding {@link ServiceLoader}
- * resource is defined in the websocket package, so that this configuration only be
- * loaded if the jetty-websocket jars are on the classpath.
- *
+ * {@code org.eclipse.jetty.websocket.util.server} packages.
*/
public class JettyWebSocketConfiguration extends AbstractConfiguration
{