diff --git a/LICENSE-binary b/LICENSE-binary
index c8bbfd29c1788c..97458c9cc9a7f0 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -625,9 +625,8 @@ CDDL 1.1 + GPLv2 with classpath exception
-----------------------------------------
com.sun.xml.bind:jaxb-impl:2.2.3-1
-javax.annotation:javax.annotation-api:1.3.2
javax.cache:cache-api:1.1.1
-javax.servlet:javax.servlet-api:3.1.0
+javax.servlet:javax.servlet-api:4.0.1
javax.servlet.jsp:jsp-api:2.1
javax.websocket:javax.websocket-api:1.0
@@ -646,9 +645,9 @@ org.jacoco:org.jacoco.agent:0.8.5
Eclipse Public License (EPL) 2.0
--------------------------
+jakarta.annotation:jakarta.annotation-api:1.3.5
jakarta.ws.rs-api:jakarta.ws.rs-api:2.1.6
jakarta.servlet.jsp:jakarta.servlet.jsp-api:2.3.6
-jakarta.servlet:jakarta.servlet-api:4.0.4
Eclipse Public License (EPL) 2.0 with some parts being
GNU General Public License (GPL), Version 2, With Classpath Exception,
@@ -662,7 +661,8 @@ org.glassfish.jersey.core:jersey-server:2.46
org.glassfish.jersey.inject:jersey-hk2:2.46
org.glassfish.jersey.core:jersey-client:2.46
org.glassfish.jersey.test-framework:jersey-test-framework-core:2.46
-org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:2.46
+org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jdk-http:2.46
+org.glassfish.jersey.containers:jersey-container-jdk-http:2.46
org.glassfish.jersey.containers:jersey-container-servlet:2.46
org.glassfish.jersey.containers:jersey-container-servlet-core:2.46
org.glassfish.jersey.media:jersey-media-json-jettison:2.46
diff --git a/NOTICE-binary b/NOTICE-binary
index 407f6c25d997a4..276f58171625c9 100644
--- a/NOTICE-binary
+++ b/NOTICE-binary
@@ -456,6 +456,9 @@ The following artifacts are EPL and ASL2.
The following artifacts are EPL and CDDL 1.0.
* org.eclipse.jetty.orbit:javax.mail.glassfish
+The following artifacts are EPL 2.0 and GPLv2 with classpath exception.
+ * jakarta.annotation:jakarta.annotation-api
+
------
Oracle
@@ -464,7 +467,6 @@ The following artifacts are CDDL + GPLv2 with classpath exception.
https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html
* javax.servlet:javax.servlet-api
- * javax.annotation:javax.annotation-api
* javax.transaction:javax.transaction-api
* javax.websocket:javax.websocket-api
diff --git a/hadoop-client-modules/hadoop-client-minicluster/pom.xml b/hadoop-client-modules/hadoop-client-minicluster/pom.xml
index 7042f2ce07880a..6ba007198b3f93 100644
--- a/hadoop-client-modules/hadoop-client-minicluster/pom.xml
+++ b/hadoop-client-modules/hadoop-client-minicluster/pom.xml
@@ -123,10 +123,6 @@
javax.servlet
javax.servlet-api
-
- jakarta.servlet
- jakarta.servlet-api
-
jakarta.ws.rs
jakarta.ws.rs-api
@@ -419,10 +415,9 @@
-
-
+
org.glassfish.jersey.core
jersey-common
@@ -464,7 +459,6 @@
-
org.apache.hadoop
@@ -475,10 +469,6 @@
javax.servlet
javax.servlet-api
-
- jakarta.servlet
- jakarta.servlet-api
-
jakarta.ws.rs
jakarta.ws.rs-api
@@ -550,10 +540,6 @@
javax.servlet
javax.servlet-api
-
- jakarta.servlet
- jakarta.servlet-api
-
jakarta.ws.rs
jakarta.ws.rs-api
@@ -619,10 +605,6 @@
jakarta.ws.rs
jakarta.ws.rs-api
-
- jakarta.servlet
- jakarta.servlet-api
-
junit-jupiter
org.junit.jupiter
@@ -632,7 +614,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
jakarta.ws.rs
@@ -645,6 +627,13 @@
true
+
+
+ org.eclipse.jetty
+ jetty-util
+ true
+
@@ -740,6 +729,15 @@
**/Test*.class
+
+
+ org.apache.hadoop:hadoop-common:*
+
+ org/apache/hadoop/test/AbstractJettyClasspathTest.class
+ org/apache/hadoop/test/ClasspathTestUtils.class
+
+
@@ -945,6 +943,8 @@
com/sun/security/**/*
com/sun/jndi/**/*
com/sun/management/**/*
+ com/sun/net/httpserver/*
+ com/sun/net/httpserver/**/*
com/ibm/security/*
com/ibm/security/**/*
diff --git a/hadoop-common-project/hadoop-auth-examples/pom.xml b/hadoop-common-project/hadoop-auth-examples/pom.xml
index 331cffc7815597..b3148cd7e3e0d9 100644
--- a/hadoop-common-project/hadoop-auth-examples/pom.xml
+++ b/hadoop-common-project/hadoop-auth-examples/pom.xml
@@ -32,8 +32,8 @@
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
provided
diff --git a/hadoop-common-project/hadoop-auth/pom.xml b/hadoop-common-project/hadoop-auth/pom.xml
index 4b8854887c1966..3fb244f4a395c2 100644
--- a/hadoop-common-project/hadoop-auth/pom.xml
+++ b/hadoop-common-project/hadoop-auth/pom.xml
@@ -62,8 +62,8 @@
test
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
provided
diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml
index f10ed425370661..e71e9e5d0971c4 100644
--- a/hadoop-common-project/hadoop-common/pom.xml
+++ b/hadoop-common-project/hadoop-common/pom.xml
@@ -131,6 +131,17 @@
jetty-server
compile
+
+
+ javax.servlet
+ javax.servlet-api
+ compile
+
org.eclipse.jetty
jetty-util
@@ -142,6 +153,15 @@
+
+
+ org.eclipse.jetty
+ jetty-http
+ compile
+ true
+
org.eclipse.jetty
jetty-servlet
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java
index d17874d78aca82..480778a394c831 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java
@@ -1960,9 +1960,7 @@ public void doFilter(ServletRequest request,
*/
private String inferMimeType(ServletRequest request) {
String path = ((HttpServletRequest)request).getRequestURI();
- ServletContextHandler.Context sContext =
- (ServletContextHandler.Context)config.getServletContext();
- String mime = sContext.getMimeType(path);
+ String mime = config.getServletContext().getMimeType(path);
return (mime == null) ? null : mime;
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java
index be1baa97c88109..a1b67a697078bb 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FSMainOperationsBaseTest.java
@@ -36,7 +36,8 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.eclipse.jetty.util.log.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -58,6 +59,9 @@
*
*/
public abstract class FSMainOperationsBaseTest extends FileSystemTestHelper {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(FSMainOperationsBaseTest.class);
+
private static String TEST_DIR_AAA2 = "test/hadoop2/aaa";
private static String TEST_DIR_AAA = "test/hadoop/aaa";
@@ -803,7 +807,7 @@ public void testRenameNonExistentPath() throws Exception {
rename(src, dst, false, false, false, Rename.NONE);
fail("Should throw FileNotFoundException");
} catch (IOException e) {
- Log.getLog().info("XXX", e);
+ LOG.info("XXX", e);
assertTrue(unwrapException(e) instanceof FileNotFoundException);
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java
index 5713f532be7e81..6482dc5936a6bd 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java
@@ -26,7 +26,8 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.viewfs.ConfigUtil;
import org.apache.hadoop.util.Shell;
-import org.eclipse.jetty.util.log.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -46,6 +47,9 @@
* We also set the view file system's wd to point to the wd.
*/
public class ViewFileSystemTestSetup {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(ViewFileSystemTestSetup.class);
+
static public String ViewFSTestDir = "/testDir";
@@ -83,7 +87,7 @@ static public FileSystem setupForViewFileSystem(Configuration conf, FileSystemTe
FileSystem fsView = FileSystem.get(FsConstants.VIEWFS_URI, conf);
fsView.setWorkingDirectory(new Path(wdDir)); // in case testdir relative to wd.
- Log.getLog().info("Working dir is: " + fsView.getWorkingDirectory());
+ LOG.info("Working dir is: " + fsView.getWorkingDirectory());
return fsView;
}
@@ -117,12 +121,12 @@ static void setUpHomeDir(Configuration conf, FileSystem fsTarget) {
} else { // home dir is at root. Just link the home dir itse
URI linkTarget = fsTarget.makeQualified(new Path(homeDir)).toUri();
ConfigUtil.addLink(conf, homeDir, linkTarget);
- Log.getLog().info("Added link for home dir " + homeDir + "->" + linkTarget);
+ LOG.info("Added link for home dir " + homeDir + "->" + linkTarget);
}
// Now set the root of the home dir for viewfs
String homeDirRoot = fsTarget.getHomeDirectory().getParent().toUri().getPath();
ConfigUtil.setHomeDirConf(conf, homeDirRoot);
- Log.getLog().info("Home dir base for viewfs" + homeDirRoot);
+ LOG.info("Home dir base for viewfs" + homeDirRoot);
}
/*
@@ -137,7 +141,7 @@ static void linkUpFirstComponents(Configuration conf, String path, FileSystem fs
String firstComponent = path.substring(0, indexOfEnd);
URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri();
ConfigUtil.addLink(conf, firstComponent, linkTarget);
- Log.getLog().info("Added link for " + info + " "
+ LOG.info("Added link for " + info + " "
+ firstComponent + "->" + linkTarget);
}
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java
index 8f9ac895946e0d..688825ac89ce67 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java
@@ -32,7 +32,8 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.viewfs.ViewFileSystemOverloadScheme.ChildFsGetter;
import org.apache.hadoop.util.Shell;
-import org.eclipse.jetty.util.log.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -53,6 +54,9 @@
*/
public class ViewFsTestSetup {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(ViewFsTestSetup.class);
+
static public String ViewFSTestDir = "/testDir";
@@ -88,7 +92,7 @@ static public FileContext setupForViewFsLocalFs(FileContextTestHelper helper) th
FileContext fc = FileContext.getFileContext(FsConstants.VIEWFS_URI, conf);
fc.setWorkingDirectory(new Path(wdDir)); // in case testdir relative to wd.
- Log.getLog().info("Working dir is: " + fc.getWorkingDirectory());
+ LOG.info("Working dir is: " + fc.getWorkingDirectory());
//System.out.println("SRCOfTests = "+ getTestRootPath(fc, "test"));
//System.out.println("TargetOfTests = "+ targetOfTests.toUri());
return fc;
@@ -113,12 +117,12 @@ static void setUpHomeDir(Configuration conf, FileContext fsTarget) {
} else { // home dir is at root. Just link the home dir itse
URI linkTarget = fsTarget.makeQualified(new Path(homeDir)).toUri();
ConfigUtil.addLink(conf, homeDir, linkTarget);
- Log.getLog().info("Added link for home dir " + homeDir + "->" + linkTarget);
+ LOG.info("Added link for home dir " + homeDir + "->" + linkTarget);
}
// Now set the root of the home dir for viewfs
String homeDirRoot = fsTarget.getHomeDirectory().getParent().toUri().getPath();
ConfigUtil.setHomeDirConf(conf, homeDirRoot);
- Log.getLog().info("Home dir base for viewfs" + homeDirRoot);
+ LOG.info("Home dir base for viewfs" + homeDirRoot);
}
/*
@@ -134,7 +138,7 @@ static void linkUpFirstComponents(Configuration conf, String path,
String firstComponent = path.substring(0, indexOfEnd);
URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri();
ConfigUtil.addLink(conf, firstComponent, linkTarget);
- Log.getLog().info("Added link for " + info + " "
+ LOG.info("Added link for " + info + " "
+ firstComponent + "->" + linkTarget);
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestAuthenticationSessionCookie.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestAuthenticationSessionCookie.java
index 545b273701fcf0..79137f25ab9e24 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestAuthenticationSessionCookie.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestAuthenticationSessionCookie.java
@@ -21,7 +21,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
-import org.eclipse.jetty.util.log.Log;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
@@ -37,8 +36,13 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class TestAuthenticationSessionCookie {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(TestAuthenticationSessionCookie.class);
+
private static final String BASEDIR =
GenericTestUtils.getTempPath(TestHttpCookieFlag.class.getSimpleName());
private static boolean isCookiePersistent;
@@ -152,7 +156,7 @@ public void testSessionCookie() throws IOException {
String header = conn.getHeaderField("Set-Cookie");
List cookies = HttpCookie.parse(header);
assertTrue(!cookies.isEmpty());
- Log.getLog().info(header);
+ LOG.info(header);
assertFalse(header.contains("; Expires="));
assertTrue("token".equals(cookies.get(0).getValue()));
}
@@ -174,7 +178,7 @@ public void testPersistentCookie() throws IOException {
String header = conn.getHeaderField("Set-Cookie");
List cookies = HttpCookie.parse(header);
assertTrue(!cookies.isEmpty());
- Log.getLog().info(header);
+ LOG.info(header);
assertTrue(header.contains("; Expires="));
assertTrue("token".equals(cookies.get(0).getValue()));
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestJettyClasspath.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestJettyClasspath.java
new file mode 100644
index 00000000000000..570f29f23652bf
--- /dev/null
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.http;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/AbstractJettyClasspathTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/AbstractJettyClasspathTest.java
new file mode 100644
index 00000000000000..722a30ea22f8d7
--- /dev/null
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/AbstractJettyClasspathTest.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.test;
+
+import org.junit.jupiter.api.Test;
+
+import static org.apache.hadoop.test.ClasspathTestUtils.assertSingleJettyRelease;
+import static org.apache.hadoop.test.ClasspathTestUtils.assertSingleServletApi;
+
+/**
+ * HADOOP-19970: the test classpath of a module that runs Hadoop's web
+ * servers resolves one servlet API and one Jetty release. A module checks
+ * its own classpath with an empty subclass named TestJettyClasspath; JUnit
+ * runs the inherited tests, so every module checks the same things.
+ */
+public abstract class AbstractJettyClasspathTest {
+
+ @Test
+ public void testSingleServletApi() throws Exception {
+ assertSingleServletApi();
+ }
+
+ @Test
+ public void testSingleJettyRelease() throws Exception {
+ assertSingleJettyRelease();
+ }
+}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/ClasspathTestUtils.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/ClasspathTestUtils.java
new file mode 100644
index 00000000000000..1d2819ee1d67a6
--- /dev/null
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/ClasspathTestUtils.java
@@ -0,0 +1,153 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Assertions on the test classpath of a module, so a module can check that
+ * it resolves one servlet API and one Jetty release (HADOOP-19970).
+ * Jars are recognised by their contents and manifests, not by their file
+ * names or repository layout, so the checks hold for a Maven repository, a
+ * Gradle cache or a flattened lib directory alike.
+ */
+public final class ClasspathTestUtils {
+
+ /**
+ * Bundle-SymbolicName of the servlet API every module resolves,
+ * javax.servlet:javax.servlet-api. Its 3.1 releases have the same name,
+ * so the Specification-Version is checked too.
+ */
+ public static final String SERVLET_API_BUNDLE = "javax.servlet-api";
+
+ /** Specification-Version of the servlet API every module resolves. */
+ public static final String SERVLET_API_SPEC = "4.0";
+
+ /**
+ * Where Jetty's classes live. A jar with classes here is a Jetty jar of
+ * whatever group (http2, websocket, alpn, ...); the servlet API and the
+ * orbit jars carry only javax.* classes and are not counted.
+ */
+ private static final String JETTY_CLASSES = "org/eclipse/jetty/";
+
+ private static final Attributes.Name BUNDLE_SYMBOLIC_NAME =
+ new Attributes.Name("Bundle-SymbolicName");
+
+ private static final Attributes.Name BUNDLE_VERSION =
+ new Attributes.Name("Bundle-Version");
+
+ private ClasspathTestUtils() {
+ }
+
+ /**
+ * Assert that exactly one classpath entry provides a resource,
+ * and that the entry is the expected bundle.
+ * @param resource resource name, such as "javax/servlet/Servlet.class".
+ * @param bundle the Bundle-SymbolicName of the jar that should provide it.
+ * @return the jar that provides it.
+ * @throws IOException if the classpath cannot be read.
+ */
+ public static JarFile assertSingleProvider(String resource, String bundle)
+ throws IOException {
+ List urls = Collections.list(
+ ClasspathTestUtils.class.getClassLoader().getResources(resource));
+ assertEquals(1, urls.size(), "providers of " + resource + ": " + urls);
+ JarFile jar = jarOf(urls.get(0));
+ assertNotNull(jar, resource + " is not in a jar: " + urls.get(0));
+ assertEquals(bundle, mainAttribute(jar, BUNDLE_SYMBOLIC_NAME),
+ "unexpected provider of " + resource + ": " + urls.get(0));
+ return jar;
+ }
+
+ /**
+ * Assert that one servlet API, javax.servlet-api 4.0, is on the classpath.
+ * @throws IOException if the classpath cannot be read.
+ */
+ public static void assertSingleServletApi() throws IOException {
+ JarFile jar = assertSingleProvider("javax/servlet/Servlet.class",
+ SERVLET_API_BUNDLE);
+ assertEquals(SERVLET_API_SPEC,
+ mainAttribute(jar, Attributes.Name.SPECIFICATION_VERSION),
+ "unexpected servlet API version: " + jar.getName());
+ }
+
+ /**
+ * Assert that the classpath carries Jetty jars, all from one release.
+ * A jar is a Jetty jar when it has classes under org/eclipse/jetty/,
+ * and its release is the Implementation-Version (or else Bundle-Version)
+ * of its manifest.
+ * @return the Jetty jars found, as "file name (release)".
+ * @throws IOException if the classpath cannot be read.
+ */
+ public static Set assertSingleJettyRelease() throws IOException {
+ Set jars = new TreeSet<>();
+ Set versions = new TreeSet<>();
+ for (URL url : Collections.list(ClasspathTestUtils.class.getClassLoader()
+ .getResources(JarFile.MANIFEST_NAME))) {
+ JarFile jar = jarOf(url);
+ if (jar == null || jar.stream().noneMatch(e ->
+ e.getName().startsWith(JETTY_CLASSES)
+ && e.getName().endsWith(".class"))) {
+ continue;
+ }
+ String version = mainAttribute(jar, Attributes.Name.IMPLEMENTATION_VERSION);
+ if (version == null) {
+ version = mainAttribute(jar, BUNDLE_VERSION);
+ }
+ jars.add(new File(jar.getName()).getName() + " (" + version + ")");
+ versions.add(String.valueOf(version));
+ }
+ assertFalse(jars.isEmpty(), "no Jetty jars found on the classpath");
+ assertEquals(1, versions.size(), "Jetty jars on the classpath: " + jars);
+ return jars;
+ }
+
+ /**
+ * The jar a classpath resource comes from.
+ * @param resource URL of a resource found through the class loader.
+ * @return the jar, shared through the JVM's jar cache, so it must not be
+ * closed; or null if the resource is in a directory.
+ * @throws IOException if the jar cannot be opened.
+ */
+ private static JarFile jarOf(URL resource) throws IOException {
+ URLConnection connection = resource.openConnection();
+ return connection instanceof JarURLConnection
+ ? ((JarURLConnection) connection).getJarFile() : null;
+ }
+
+ private static String mainAttribute(JarFile jar, Attributes.Name name)
+ throws IOException {
+ Manifest manifest = jar.getManifest();
+ return manifest == null ? null : manifest.getMainAttributes().getValue(name);
+ }
+}
diff --git a/hadoop-common-project/hadoop-kms/pom.xml b/hadoop-common-project/hadoop-kms/pom.xml
index e2874eb3a8033a..cfa42081f05a3a 100644
--- a/hadoop-common-project/hadoop-kms/pom.xml
+++ b/hadoop-common-project/hadoop-kms/pom.xml
@@ -69,8 +69,8 @@
compile
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
org.eclipse.jetty
diff --git a/hadoop-common-project/hadoop-nfs/pom.xml b/hadoop-common-project/hadoop-nfs/pom.xml
index 685397e131d427..55c0033ff75115 100644
--- a/hadoop-common-project/hadoop-nfs/pom.xml
+++ b/hadoop-common-project/hadoop-nfs/pom.xml
@@ -59,8 +59,8 @@
test
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
provided
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml
index f0c0e21ac12e50..7d542ee27847de 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml
@@ -63,8 +63,8 @@
compile
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
compile
@@ -81,6 +81,12 @@
org.eclipse.jetty
jetty-server
+
+
+ org.eclipse.jetty
+ jetty-http
+ true
+
org.glassfish.jaxb
jaxb-runtime
@@ -90,6 +96,16 @@
org.eclipse.jetty
jetty-webapp
+
+ org.eclipse.jetty
+ jetty-servlet
+
+
+
+ org.eclipse.jetty
+ jetty-util
+ true
+
org.apache.hadoop
hadoop-common
diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-nfs/pom.xml
index 38f293c1c34cc6..e862be8daf6623 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-nfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/pom.xml
@@ -149,8 +149,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
${transient.protobuf2.scope}
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
compile
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 07154ccdf7f872..da94bbc093340f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -87,6 +87,13 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
jetty-util
compile
+
+
+ org.eclipse.jetty
+ jetty-io
+ compile
+ true
+
org.glassfish.jersey.core
jersey-common
@@ -142,8 +149,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
${transient.protobuf2.scope}
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
compile
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/pom.xml
index 4184166ebd3394..9583523ce553c5 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/pom.xml
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/pom.xml
@@ -131,7 +131,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/pom.xml
index 3c0ceda9cb1fe3..146d07dd1a4bca 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/pom.xml
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/pom.xml
@@ -148,6 +148,16 @@
junit-platform-launcher
test
+
+ org.eclipse.jetty
+ jetty-server
+ provided
+
+
+ org.eclipse.jetty
+ jetty-servlet
+ provided
+
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml
index f54f4162a8ddb0..fd8a14b1372b57 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml
@@ -55,6 +55,12 @@
${leveldbjni.group}
leveldbjni-all
+
+
+ org.eclipse.jetty
+ jetty-http
+ true
+
ch.qos.logback
logback-classic
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestJettyClasspath.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestJettyClasspath.java
new file mode 100644
index 00000000000000..9cb604118fd6e0
--- /dev/null
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.mapred;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml
index acca311eb53c03..0ec8950a4234e8 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml
@@ -161,7 +161,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-examples/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-examples/pom.xml
index 1e02c05fe75b32..45041b3668c74a 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-examples/pom.xml
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-examples/pom.xml
@@ -101,7 +101,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index d0eaa4f47e10d7..3059486476020c 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -37,6 +37,7 @@
true
true
9.4.58.v20250814
+ 4.0.1
_
_
@@ -904,18 +905,22 @@
org.eclipse.jetty
jetty-server
${jetty.version}
-
-
- org.eclipse.jetty
- javax.servlet-api
-
-
org.eclipse.jetty
jetty-util
${jetty.version}
+
+ org.eclipse.jetty
+ jetty-http
+ ${jetty.version}
+
+
+ org.eclipse.jetty
+ jetty-io
+ ${jetty.version}
+
org.eclipse.jetty
jetty-servlet
@@ -939,6 +944,11 @@
org.eclipse.jetty
jetty-webapp
+
+
+ javax.annotation
+ javax.annotation-api
+
@@ -951,10 +961,20 @@
jakarta.servlet.jsp-api
2.3.6
+
- jakarta.servlet
- jakarta.servlet-api
- 4.0.4
+ javax.servlet
+ javax.servlet-api
+ ${javax.servlet-api.version}
@@ -2174,10 +2194,24 @@
org.glassfish.jersey.test-framework
jersey-test-framework-core
${jersey2.version}
+
+
+
+ jakarta.servlet
+ jakarta.servlet-api
+
+
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
${jersey2.version}
diff --git a/hadoop-tools/hadoop-resourceestimator/pom.xml b/hadoop-tools/hadoop-resourceestimator/pom.xml
index 2f88db06db37cd..f22a1336b6b549 100644
--- a/hadoop-tools/hadoop-resourceestimator/pom.xml
+++ b/hadoop-tools/hadoop-resourceestimator/pom.xml
@@ -67,12 +67,12 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
org.glassfish.jersey.core
diff --git a/hadoop-tools/hadoop-sls/pom.xml b/hadoop-tools/hadoop-sls/pom.xml
index af9a37b3cd61a9..567a07e38f1d16 100644
--- a/hadoop-tools/hadoop-sls/pom.xml
+++ b/hadoop-tools/hadoop-sls/pom.xml
@@ -52,18 +52,17 @@
org.eclipse.jetty
jetty-server
provided
-
-
- org.eclipse.jetty
- javax.servlet-api
-
-
org.eclipse.jetty
jetty-util
provided
+
+ org.eclipse.jetty
+ jetty-http
+ provided
+
com.fasterxml.jackson.core
jackson-databind
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp/pom.xml
index e96f108bcd7003..c8b9e0b8460049 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp/pom.xml
@@ -160,9 +160,16 @@
+
org.apache.solr
- solr-core
+ solr-test-framework
${solr.version}
@@ -209,58 +216,49 @@
org.eclipse.jetty.http2
http2-http-client-transport
-
- test
-
-
-
- org.apache.solr
- solr-test-framework
- ${solr.version}
-
- org.slf4j
- jcl-over-slf4j
+ org.eclipse.jetty
+ jetty-alpn-java-client
org.eclipse.jetty
- jetty-io
+ jetty-alpn-server
org.eclipse.jetty
- jetty-xml
+ jetty-alpn-java-server
org.eclipse.jetty
- jetty-http
+ jetty-continuation
org.eclipse.jetty
- jetty-client
+ jetty-deploy
org.eclipse.jetty
- jetty-alpn-client
+ jetty-jmx
- commons-collections
- commons-collections
+ org.eclipse.jetty
+ jetty-rewrite
- org.eclipse.jetty.http2
- http2-hpack
+ org.eclipse.jetty
+ jetty-security
- org.eclipse.jetty.http2
- http2-client
+ org.eclipse.jetty
+ jetty-servlets
org.eclipse.jetty.http2
- http2-common
+ http2-server
- org.eclipse.jetty.http2
- http2-http-client-transport
+ javax.servlet
+ javax.servlet-api
test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/pom.xml
index 4e5f602cf387ce..57829ed43e4fe1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/pom.xml
@@ -136,8 +136,8 @@
jakarta.ws.rs-api
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
commons-codec
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
index 04a78a94a54e96..88c5b1ac392b82 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
@@ -91,7 +91,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
index 2da782ea6db1c0..524f5240d7579a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
@@ -87,14 +87,18 @@
import org.mockito.ArgumentCaptor;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import org.eclipse.jetty.util.log.Log;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Test application master client class to resource manager.
*/
public class TestAMRMClient extends BaseAMRMClientTest{
+ private static final Logger LOG =
+ LoggerFactory.getLogger(TestAMRMClient.class);
+
private final static int DEFAULT_ITERATION = 15;
@@ -555,7 +559,7 @@ public void testAMRMClientMatchStorage(String pSchedulerName,
int iterationsLeft = 15;
while (allocatedContainerCount < 2
&& iterationsLeft-- > 0) {
- Log.getLog().info("Allocated " + allocatedContainerCount + " containers"
+ LOG.info("Allocated " + allocatedContainerCount + " containers"
+ " with " + iterationsLeft + " iterations left");
AllocateResponse allocResponse = amClient.allocate(0.1f);
assertEquals(0, amClient.ask.size());
@@ -752,7 +756,7 @@ private int getAllocatedContainersNumber(
throws YarnException, IOException {
int allocatedContainerCount = 0;
while (iterationsLeft-- > 0) {
- Log.getLog().info("Allocated " + allocatedContainerCount + " containers"
+ LOG.info("Allocated " + allocatedContainerCount + " containers"
+ " with " + iterationsLeft + " iterations left");
AllocateResponse allocResponse = amClient.allocate(0.1f);
assertEquals(0, amClient.ask.size());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
index 1848a921222e0b..a984c80bb69534 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
@@ -106,7 +106,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
-import org.eclipse.jetty.util.log.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -385,11 +384,11 @@ public void testGetContainers() throws Exception {
"http://host:2345", "");
pw.close();
String appReportStr = baos.toString("UTF-8");
- Log.getLog().info("ExpectedOutput");
- Log.getLog().info("["+appReportStr+"]");
- Log.getLog().info("OutputFrom command");
+ LOG.info("ExpectedOutput");
+ LOG.info("["+appReportStr+"]");
+ LOG.info("OutputFrom command");
String actualOutput = sysOutStream.toString("UTF-8");
- Log.getLog().info("["+actualOutput+"]");
+ LOG.info("["+actualOutput+"]");
assertEquals(appReportStr, actualOutput);
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
index fdfec1d7d1ca6a..25abf93b5c1ab2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
@@ -65,8 +65,8 @@
commons-compress
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
commons-codec
@@ -76,6 +76,11 @@
org.eclipse.jetty
jetty-util
+
+ org.eclipse.jetty
+ jetty-webapp
+ provided
+
org.apache.hadoop.thirdparty
hadoop-shaded-guava
@@ -148,14 +153,8 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
-
-
- jakarta.servlet-api
- jakarta.servlet
-
-
jakarta.ws.rs
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/TestJettyClasspath.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/TestJettyClasspath.java
new file mode 100644
index 00000000000000..14868714728f22
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.webapp;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
index b35bb52121684e..fe5fbe43bb6986 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
@@ -38,8 +38,8 @@
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
@@ -47,6 +47,16 @@
hadoop-common
provided
+
+ org.eclipse.jetty
+ jetty-webapp
+ provided
+
+
+ org.eclipse.jetty
+ jetty-servlet
+ provided
+
@@ -92,7 +102,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestJettyClasspath.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestJettyClasspath.java
new file mode 100644
index 00000000000000..f6f2dff3f9af49
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TestRollingLevelDBTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TestRollingLevelDBTimelineStore.java
index 6d37a9730e1d51..a9882a87bcd6ae 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TestRollingLevelDBTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TestRollingLevelDBTimelineStore.java
@@ -21,13 +21,14 @@
import java.io.FilenameFilter;
import java.io.IOException;
-import org.eclipse.jetty.util.log.Log;
import org.fusesource.leveldbjni.JniDBFactory;
import org.iq80.leveldb.Options;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.apache.hadoop.classification.InterfaceAudience;
@@ -55,6 +56,8 @@
@InterfaceAudience.Private
@InterfaceStability.Unstable
public class TestRollingLevelDBTimelineStore extends TimelineStoreTestUtils {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(TestRollingLevelDBTimelineStore.class);
private FileContext fsContext;
private File fsPath;
private Configuration config = new YarnConfiguration();
@@ -375,7 +378,7 @@ public void testStorePerformance() throws IOException {
long start = System.currentTimeMillis();
int num = 1000000;
- Log.getLog().info("Start test for " + num);
+ LOG.info("Start test for {}", num);
final String tezTaskAttemptId = "TEZ_TA";
final String tezEntityId = "attempt_1429158534256_0001_1_00_000000_";
@@ -421,7 +424,7 @@ public void testStorePerformance() throws IOException {
}
long duration = System.currentTimeMillis() - start;
- Log.getLog().info("Duration for " + num + ": " + duration);
+ LOG.info("Duration for {}: {}", num, duration);
}
/**
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
index fe166cd1c1abbb..be53cacd8f2ee0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
@@ -119,8 +119,8 @@
leveldbjni-all
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
javax.cache
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-globalpolicygenerator/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-globalpolicygenerator/pom.xml
index 05913c2832733b..4137651b7a270f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-globalpolicygenerator/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-globalpolicygenerator/pom.xml
@@ -119,13 +119,13 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
index afde1fa415a6bc..aa8bf7b6e4a9f0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
@@ -70,8 +70,8 @@
jettison
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
commons-codec
@@ -81,6 +81,10 @@
org.eclipse.jetty
jetty-util
+
+ org.eclipse.jetty
+ jetty-servlet
+
org.eclipse.jetty.websocket
javax-websocket-server-impl
@@ -203,7 +207,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java
index 86d78f2fc351ae..18376bc939549e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java
@@ -99,7 +99,6 @@
import org.apache.hadoop.yarn.util.ConverterUtils;
import org.apache.hadoop.yarn.util.MonotonicClock;
import org.apache.hadoop.yarn.util.resource.Resources;
-import org.eclipse.jetty.util.ConcurrentHashSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -290,7 +289,7 @@ public FederationInterceptor() {
this.finishAMCalled = false;
this.lastSCResponseTime = new ConcurrentHashMap<>();
this.lastAMHeartbeatTime = this.clock.getTime();
- this.nmTokenMapFromRegisterSecondaryCluster = new ConcurrentHashSet<>();
+ this.nmTokenMapFromRegisterSecondaryCluster = ConcurrentHashMap.newKeySet();
}
/**
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java
index 5c2ba9c0942a46..20913b208c5def 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java
@@ -46,7 +46,6 @@
import static org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.LinuxContainerRuntimeConstants.CONTAINER_ID_STR;
import static org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker.DockerCommandExecutor.DockerContainerStatus;
-import static org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.LOG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -55,11 +54,16 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Test common docker commands.
*/
public class TestDockerCommandExecutor {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(TestDockerCommandExecutor.class);
+
private static final String MOCK_CONTAINER_ID =
"container_e11_1861047502093_13763105_01_000001";
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
index 224acf12129d1b..44be80df0a708f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
@@ -156,7 +156,6 @@
import org.junit.jupiter.api.Timeout;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
-import org.eclipse.jetty.util.MultiException;
import java.util.function.Supplier;
import org.slf4j.LoggerFactory;
@@ -1452,7 +1451,7 @@ void checkEvents(EventHandler eventHandler,
List actualEvents = eventCaptor.getAllValues();
// batch up exceptions so junit presents them as one
- MultiException failures = new MultiException();
+ List failures = new ArrayList<>();
try {
assertEquals(expectedEvents.length, actualEvents.size(), "expected events");
} catch (Throwable e) {
@@ -1495,7 +1494,11 @@ void checkEvents(EventHandler eventHandler,
}
}
}
- failures.ifExceptionThrow();
+ if (!failures.isEmpty()) {
+ AssertionError error = new AssertionError(failures.size() + " failures");
+ failures.forEach(error::addSuppressed);
+ throw error;
+ }
}
private static String eventToString(Event> event, String[] methods) throws Exception {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestAnnotationApiClasspath.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestAnnotationApiClasspath.java
new file mode 100644
index 00000000000000..4b759d36f122b6
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestAnnotationApiClasspath.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.nodemanager.webapp;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * HADOOP-20013: the NodeManager is the module that declares
+ * javax-websocket-server-impl, whose jetty-annotations brings
+ * javax.annotation-api, a second copy of the javax.annotation classes that
+ * jakarta.annotation-api already provides. Its test classpath keeps one.
+ */
+public class TestAnnotationApiClasspath {
+
+ @Test
+ public void testSingleAnnotationApi() throws Exception {
+ String resource = "javax/annotation/PostConstruct.class";
+ List providers = Collections.list(
+ getClass().getClassLoader().getResources(resource));
+ assertEquals(1, providers.size(), "providers of " + resource + ": "
+ + providers);
+ assertTrue(providers.get(0).toString().contains("/jakarta.annotation-api-"),
+ "unexpected provider of " + resource + ": " + providers.get(0));
+ }
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestJettyClasspath.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestJettyClasspath.java
new file mode 100644
index 00000000000000..9d7b04dc273e77
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.nodemanager.webapp;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
index 40dcf5d390b558..51e5da26dbbfdf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
@@ -33,8 +33,8 @@
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
@@ -145,6 +145,11 @@
org.eclipse.jetty
jetty-util
+
+ org.eclipse.jetty
+ jetty-webapp
+ provided
+
org.apache.hadoop.thirdparty
hadoop-shaded-guava
@@ -244,7 +249,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockNM.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockNM.java
index d433753701b25e..7b3b3e51daff2d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockNM.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockNM.java
@@ -55,9 +55,13 @@
import org.apache.hadoop.yarn.util.Records;
import org.apache.hadoop.yarn.util.YarnVersionInfo;
import org.apache.hadoop.yarn.util.resource.Resources;
-import org.eclipse.jetty.util.log.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class MockNM {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(MockNM.class);
+
private int responseId;
private NodeId nodeId;
@@ -238,7 +242,7 @@ public NodeHeartbeatResponse nodeHeartbeat(ApplicationAttemptId attemptId,
ArrayList containerStatusList =
new ArrayList(1);
containerStatusList.add(containerStatus);
- Log.getLog().info("ContainerStatus: " + containerStatus);
+ LOG.info("ContainerStatus: " + containerStatus);
return nodeHeartbeat(containerStatusList,
Collections.emptyList(), true, responseId);
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/pom.xml
index 67fc6348f7edc0..ef5a33accde6be 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/pom.xml
@@ -43,6 +43,24 @@
hadoop-common
+
+ org.eclipse.jetty
+ jetty-webapp
+
+
+
+ org.eclipse.jetty
+ jetty-server
+
+
+ org.eclipse.jetty
+ jetty-servlet
+
+
+ org.eclipse.jetty
+ jetty-util
+
+
org.apache.hadoop
hadoop-yarn-common
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestJettyClasspath.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestJettyClasspath.java
new file mode 100644
index 00000000000000..6dbbd703b0f72f
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestJettyClasspath.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.server.router.webapp;
+
+import org.apache.hadoop.test.AbstractJettyClasspathTest;
+
+/**
+ * HADOOP-19970: this module's test classpath resolves one servlet API and
+ * one Jetty release. The tests are inherited.
+ */
+public class TestJettyClasspath extends AbstractJettyClasspathTest {
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
index 9b6f8f4a79e967..a0ed7bb49b1eca 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
@@ -222,7 +222,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
org.glassfish.jersey.test-framework
@@ -319,6 +319,10 @@
org.apache.hadoop
hadoop-distcp
+
+ javax.servlet
+ javax.servlet-api
+
@@ -356,6 +360,10 @@
org.apache.hadoop
hadoop-distcp
+
+ javax.servlet
+ javax.servlet-api
+
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
index 180b15713b4268..57f1d064b46a02 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
@@ -88,8 +88,8 @@
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
index 6c64dce18ebbee..791e3538a4d617 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
@@ -33,8 +33,8 @@
- jakarta.servlet
- jakarta.servlet-api
+ javax.servlet
+ javax.servlet-api
compile
@@ -98,6 +98,15 @@
org.eclipse.jetty
jetty-server
+
+ org.eclipse.jetty
+ jetty-servlet
+ provided
+
+
+ org.eclipse.jetty
+ jetty-util
+
org.glassfish.jaxb
jaxb-runtime
@@ -123,7 +132,7 @@
org.glassfish.jersey.test-framework.providers
- jersey-test-framework-provider-jetty
+ jersey-test-framework-provider-jdk-http
test