From 41717f17d7d6f0ab05e58e49f1c54af773aeeb85 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 10:37:14 -0600 Subject: [PATCH 01/25] Update from spring 5 to 6 --- tds-platform/build.gradle | 4 ++-- tds-testing-platform/build.gradle | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 633cb0afff..21cd8d5684 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -14,8 +14,8 @@ dependencies { // If there is a conflict (previously hidden by optimistic resolution), we should get an error when we build, and // at that point we can take things on a case-by-case basis. api enforcedPlatform("edu.ucar:netcdf-java-bom:${depVersion.netcdfJava}") - api enforcedPlatform('org.springframework:spring-framework-bom:5.3.39') - api enforcedPlatform('org.springframework.security:spring-security-bom:5.7.12') + api enforcedPlatform('org.springframework:spring-framework-bom:6.1.12') + api enforcedPlatform('org.springframework.security:spring-security-bom:6.3.1') api platform('net.openhft:chronicle-bom:2.25ea62') api enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.17.1") api enforcedPlatform("jakarta.platform:jakarta.jakartaee-bom:8.0.0") diff --git a/tds-testing-platform/build.gradle b/tds-testing-platform/build.gradle index fefd54b9e5..e12c2b04b3 100644 --- a/tds-testing-platform/build.gradle +++ b/tds-testing-platform/build.gradle @@ -15,10 +15,7 @@ dependencies { constraints { // Spring - // Spring-test v5.3.4 introduced a hard dependency on servlet api v4. - // That will be rolled back in v5.4.5, so for now, we specifically ask for - // spring-test 5.3.3. - api 'org.springframework:spring-test:5.3.32' + api 'org.springframework:spring-test' // dap4 // defined in tds-platform as well, but using runtime config From f2400c7738b19ea131d5ee86badcb521b4e99cbc Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 10:40:50 -0600 Subject: [PATCH 02/25] Rename variable from javax to jakarta --- dap4/d4ts/build.gradle | 2 +- gradle/any/shared-mvn-coords.gradle | 4 ++-- opendap/dtswar/build.gradle | 2 +- tds/build.gradle | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dap4/d4ts/build.gradle b/dap4/d4ts/build.gradle index b20cf3aaf3..ba116d744b 100644 --- a/dap4/d4ts/build.gradle +++ b/dap4/d4ts/build.gradle @@ -8,7 +8,7 @@ dependencies { implementation 'edu.ucar:dap4' implementation project(":dap4:d4servlet") - providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" + providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" compileOnly 'org.slf4j:slf4j-api' diff --git a/gradle/any/shared-mvn-coords.gradle b/gradle/any/shared-mvn-coords.gradle index 70047bc50e..1f58726811 100644 --- a/gradle/any/shared-mvn-coords.gradle +++ b/gradle/any/shared-mvn-coords.gradle @@ -25,8 +25,8 @@ ext { depVersion.jaxen = '1.1.6' depVersion.netcdfJava = '5.6.1-SNAPSHOT' // gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven - // coordinates for javax.servlet-api if the gradle plugin in applied. If we don't, we see errors like this: - depVersion.javaxServletApi = '4.0.3' + // coordinates for jakarta.servlet-api if the gradle plugin in applied. If we don't, we see errors like this: + depVersion.jakartaServletApi = '4.0.3' depVersion.hibernateValidator = '6.2.5.Final' // TODO: figure out way to keep this version in sync with netcdf-java version // It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't diff --git a/opendap/dtswar/build.gradle b/opendap/dtswar/build.gradle index 9abbafd6f3..9de65c4202 100644 --- a/opendap/dtswar/build.gradle +++ b/opendap/dtswar/build.gradle @@ -14,7 +14,7 @@ dependencies { implementation 'org.jdom:jdom2' implementation 'org.slf4j:slf4j-api' - providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" + providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" runtimeOnly 'org.apache.taglibs:taglibs-standard-spec' runtimeOnly 'org.apache.taglibs:taglibs-standard-impl' diff --git a/tds/build.gradle b/tds/build.gradle index 68c111ccc9..b678c81857 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -38,7 +38,7 @@ dependencies { implementation project(':dap4:d4servlet') // Server stuff - providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" + providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" runtimeOnly 'org.apache.taglibs:taglibs-standard-spec' runtimeOnly 'org.apache.taglibs:taglibs-standard-impl' @@ -94,7 +94,7 @@ dependencies { implementation 'org.thymeleaf:thymeleaf-spring5' // Testing - testImplementation "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" + testImplementation "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" testImplementation 'org.springframework:spring-test' testImplementation 'org.hamcrest:hamcrest-core' testImplementation 'commons-io:commons-io' From 175d8c32d4b75cf6fea29d79bb57cdce352b548d Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 11:39:24 -0600 Subject: [PATCH 03/25] Use jarkarta servlet 5.0.0 (Jakarta EE 9) and update imports --- .../main/java/dap4/servlet/DapController.java | 6 +++--- .../src/main/java/dap4/servlet/DapDSR.java | 2 +- .../src/main/java/dap4/servlet/DapRequest.java | 4 ++-- .../src/main/java/dap4/d4ts/D4TSServlet.java | 6 +++--- dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java | 4 ++-- .../src/main/java/dap4/d4ts/HttpHeadFilter.java | 10 +++++----- gradle/any/shared-mvn-coords.gradle | 2 +- .../src/main/java/opendap/dts/DTSServlet.java | 16 ++++++++-------- .../java/opendap/servlet/AbstractServlet.java | 8 ++++---- .../src/main/java/opendap/servlet/ReqState.java | 8 ++++---- tds-platform/build.gradle | 2 +- .../java/opendap/test/TestNcmlWithOpendap.java | 2 +- .../server/fileserver/TestFileServer.java | 2 +- .../server/fileserver/TestPartialContent.java | 2 +- .../server/ncss/NcssGridIntegrationTest.java | 2 +- .../ncss/TestNcssGridWithSwappedDimensions.java | 2 +- .../server/notebook/TestNotebookServices.java | 2 +- .../server/services/TestEnhancements.java | 2 +- .../thredds/server/wms/TestUpdateWmsServer.java | 2 +- .../java/thredds/server/wms/TestWmsServer.java | 2 +- .../java/thredds/tds/TestS3Ncml.java | 2 +- .../java/thredds/tds/TestZarr.java | 2 +- .../thredds/core/ConfigCatalogHtmlWriter.java | 4 ++-- .../main/java/thredds/core/DatasetManager.java | 4 ++-- .../java/thredds/core/TdsRequestedDataset.java | 4 ++-- .../java/thredds/server/TdsErrorHandling.java | 4 ++-- .../server/admin/AdminCollectionController.java | 4 ++-- .../server/admin/AdminDebugController.java | 4 ++-- .../server/admin/AdminDirDisplayController.java | 4 ++-- .../thredds/server/admin/AdminLogController.java | 4 ++-- .../java/thredds/server/admin/DebugCommands.java | 4 ++-- .../java/thredds/server/admin/HtmlWriting.java | 2 +- .../catalogservice/CatalogServiceController.java | 4 ++-- .../catalogservice/CatalogViewContextParser.java | 2 +- .../RemoteCatalogServiceController.java | 4 ++-- .../server/cdmremote/CdmRemoteController.java | 4 ++-- .../java/thredds/server/config/TdsContext.java | 4 ++-- .../java/thredds/server/dap4/Dap4Controller.java | 4 ++-- .../server/fileserver/FileServerController.java | 6 +++--- .../server/metadata/MetadataController.java | 4 ++-- .../ncss/controller/AbstractNcssController.java | 4 ++-- .../ncss/controller/NcssGridController.java | 4 ++-- .../ncss/controller/NcssPointController.java | 4 ++-- .../server/ncss/view/dsg/DsgSubsetWriter.java | 2 +- .../notebook/JupyterNotebookViewerService.java | 2 +- .../server/notebook/NotebookController.java | 4 ++-- .../server/opendap/GetHTMLInterfaceHandler2.java | 4 ++-- .../thredds/server/opendap/OpendapServlet.java | 10 +++++----- .../opendap/OpendapSessionAttributeListener.java | 4 ++-- .../radarServer2/RadarServerController.java | 2 +- .../java/thredds/server/root/RootController.java | 6 +++--- .../java/thredds/server/root/TestController.java | 4 ++-- .../main/java/thredds/server/viewer/Viewer.java | 2 +- .../thredds/server/viewer/ViewerController.java | 4 ++-- .../server/viewer/ViewerLinkProvider.java | 2 +- .../thredds/server/viewer/ViewerService.java | 2 +- .../thredds/server/viewer/ViewerServiceImpl.java | 2 +- .../main/java/thredds/server/views/FileView.java | 6 +++--- .../thredds/server/views/InvCatalogXmlView.java | 4 ++-- .../main/java/thredds/server/views/XmlView.java | 4 ++-- .../thredds/server/views/XsltForHtmlView.java | 4 ++-- .../java/thredds/server/wcs/VersionHandler.java | 8 ++++---- .../java/thredds/server/wcs/WCSController.java | 6 +++--- .../main/java/thredds/server/wcs/WcsHandler.java | 6 +++--- .../thredds/server/wcs/WcsRequestParser.java | 4 ++-- .../java/thredds/server/wfs/WFSController.java | 6 +++--- .../thredds/server/wfs/WFSExceptionWriter.java | 2 +- .../java/thredds/server/wms/Godiva3Viewer.java | 2 +- .../thredds/server/wms/ThreddsWmsServlet.java | 4 ++-- .../main/java/thredds/servlet/DatasetSource.java | 4 ++-- .../main/java/thredds/servlet/ServletUtil.java | 14 +++++++------- tds/src/main/java/thredds/servlet/UsageLog.java | 2 +- .../thredds/servlet/filter/CookieFilter.java | 4 ++-- .../thredds/servlet/filter/HttpHeadFilter.java | 10 +++++----- .../RequestBracketingLogMessageFilter.java | 8 ++++---- .../servlet/filter/RequestPathFilter.java | 8 ++++---- .../servlet/filter/RequestQueryFilter.java | 6 +++--- .../filter/TdsServletResponseWrapper.java | 4 ++-- .../thredds/servlet/restrict/Authorizer.java | 8 ++++---- .../thredds/servlet/restrict/AuthorizerNoop.java | 6 +++--- .../thredds/servlet/restrict/CAMSAuthorizer.java | 8 ++++---- .../restrict/RestrictedAccessController.java | 6 +++--- .../servlet/restrict/TomcatAuthorizer.java | 8 ++++---- .../java/thredds/util/RequestForwardUtils.java | 10 +++++----- tds/src/main/java/thredds/util/TdsPathUtils.java | 2 +- .../thredds/mock/web/MockTdsServletContext.java | 4 ++-- .../server/catalogservice/TestContext.java | 2 +- .../server/opendap/OpendapServletTest.java | 4 ++-- .../thredds/server/root/RootControllerTest.java | 2 +- .../serverinfo/ServerInfoControllerTest.java | 2 +- .../java/thredds/server/wms/TestWmsCache.java | 4 ++-- .../thredds/servlet/DatasetSourceExample.java | 4 ++-- 92 files changed, 204 insertions(+), 204 deletions(-) diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java index f72b36925f..022aa683a0 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java @@ -11,9 +11,9 @@ import dap4.core.dmr.*; import dap4.core.util.*; import dap4.dap4lib.*; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; import java.net.MalformedURLException; import java.nio.ByteOrder; diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java index 2447c8bb5e..d6774abc35 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java @@ -9,7 +9,7 @@ import dap4.dap4lib.DapProtocol; import dap4.dap4lib.RequestMode; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java index 811e7a0958..e752110801 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java @@ -7,8 +7,8 @@ import dap4.core.util.*; import dap4.dap4lib.RequestMode; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; import java.net.URISyntaxException; diff --git a/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java b/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java index 59ae59c7c1..6cbbcb0273 100644 --- a/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java +++ b/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java @@ -12,9 +12,9 @@ import dap4.dap4lib.DapLog; import dap4.servlet.*; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.FileInputStream; import java.io.IOException; diff --git a/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java b/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java index 322620282d..11cfb87d4b 100644 --- a/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java +++ b/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java @@ -11,8 +11,8 @@ import dap4.dap4lib.DapLog; import dap4.servlet.DapRequest; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; import java.net.MalformedURLException; import java.net.URL; diff --git a/dap4/d4ts/src/main/java/dap4/d4ts/HttpHeadFilter.java b/dap4/d4ts/src/main/java/dap4/d4ts/HttpHeadFilter.java index 49bb7659c0..3acbe07f90 100644 --- a/dap4/d4ts/src/main/java/dap4/d4ts/HttpHeadFilter.java +++ b/dap4/d4ts/src/main/java/dap4/d4ts/HttpHeadFilter.java @@ -12,11 +12,11 @@ */ package dap4.d4ts; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; diff --git a/gradle/any/shared-mvn-coords.gradle b/gradle/any/shared-mvn-coords.gradle index 1f58726811..5832888d88 100644 --- a/gradle/any/shared-mvn-coords.gradle +++ b/gradle/any/shared-mvn-coords.gradle @@ -26,7 +26,7 @@ ext { depVersion.netcdfJava = '5.6.1-SNAPSHOT' // gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven // coordinates for jakarta.servlet-api if the gradle plugin in applied. If we don't, we see errors like this: - depVersion.jakartaServletApi = '4.0.3' + depVersion.jakartaServletApi = '5.0.0' depVersion.hibernateValidator = '6.2.5.Final' // TODO: figure out way to keep this version in sync with netcdf-java version // It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't diff --git a/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java b/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java index 0e06747c9b..c767a9bdff 100644 --- a/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java +++ b/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java @@ -51,12 +51,12 @@ import opendap.util.Debug; import org.apache.http.HttpStatus; import ucar.nc2.util.EscapeStrings; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; import java.util.*; import java.nio.charset.StandardCharsets; @@ -73,7 +73,7 @@ * reduce the bulk of this file, many of these methods have been * in wrapper classes in this package (opendap.servlet). *

- * This code relies on the javax.servlet.ServletConfig + * This code relies on the jakarta.servlet.ServletConfig * interface (in particular the getInitParameter() method) * to record detailed configuration information used by * the servlet and it's children. @@ -135,7 +135,7 @@ * types. *

* Configuration:
- * The AbstractServlet relies on the javax.servlet.ServletConfig + * The AbstractServlet relies on the jakarta.servlet.ServletConfig * interface (in particular the getInitParameter() method) * to retrieve configuration information used by the servlet. * InitParameters: diff --git a/opendap/server/src/main/java/opendap/servlet/AbstractServlet.java b/opendap/server/src/main/java/opendap/servlet/AbstractServlet.java index 03dbb21b3e..63ee49ebb9 100644 --- a/opendap/server/src/main/java/opendap/servlet/AbstractServlet.java +++ b/opendap/server/src/main/java/opendap/servlet/AbstractServlet.java @@ -44,8 +44,8 @@ import java.nio.charset.StandardCharsets; import java.util.*; import java.util.zip.DeflaterOutputStream; -import javax.servlet.*; -import javax.servlet.http.*; +import jakarta.servlet.*; +import jakarta.servlet.http.*; import opendap.dap.*; import opendap.servers.*; import opendap.dap.parsers.ParseException; @@ -69,7 +69,7 @@ * be where the server specific OPeNDAP server data types are * used via their associated class factory. *

- * This code relies on the javax.servlet.ServletConfig + * This code relies on the jakarta.servlet.ServletConfig * interface (in particular the getInitParameter() method) * to record detailed configuration information used by * the servlet and it's children. @@ -126,7 +126,7 @@ */ -public abstract class AbstractServlet extends javax.servlet.http.HttpServlet { +public abstract class AbstractServlet extends jakarta.servlet.http.HttpServlet { ////////////////////////////////////////////////// // Statics diff --git a/opendap/server/src/main/java/opendap/servlet/ReqState.java b/opendap/server/src/main/java/opendap/servlet/ReqState.java index fcc105b42e..f2cefcd1a5 100644 --- a/opendap/server/src/main/java/opendap/servlet/ReqState.java +++ b/opendap/server/src/main/java/opendap/servlet/ReqState.java @@ -43,10 +43,10 @@ import opendap.dap.DAP2Exception; import ucar.httpservices.HTTPUtil; import ucar.unidata.util.StringUtil2; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * User requests get cached here so that downstream code can access diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 21cd8d5684..61875a72ca 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -18,7 +18,7 @@ dependencies { api enforcedPlatform('org.springframework.security:spring-security-bom:6.3.1') api platform('net.openhft:chronicle-bom:2.25ea62') api enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.17.1") - api enforcedPlatform("jakarta.platform:jakarta.jakartaee-bom:8.0.0") + api enforcedPlatform("jakarta.platform:jakarta.jakartaee-bom:9.0.0") constraints { diff --git a/tds/src/integrationTests/java/opendap/test/TestNcmlWithOpendap.java b/tds/src/integrationTests/java/opendap/test/TestNcmlWithOpendap.java index e6d2742b09..3f7c44d83d 100644 --- a/tds/src/integrationTests/java/opendap/test/TestNcmlWithOpendap.java +++ b/tds/src/integrationTests/java/opendap/test/TestNcmlWithOpendap.java @@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets; import java.text.DecimalFormat; import java.util.Arrays; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import thredds.test.util.TestOnLocalServer; import ucar.ma2.Array; diff --git a/tds/src/integrationTests/java/thredds/server/fileserver/TestFileServer.java b/tds/src/integrationTests/java/thredds/server/fileserver/TestFileServer.java index b8d46deec1..a5607fe1b1 100644 --- a/tds/src/integrationTests/java/thredds/server/fileserver/TestFileServer.java +++ b/tds/src/integrationTests/java/thredds/server/fileserver/TestFileServer.java @@ -8,7 +8,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Optional; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; diff --git a/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java b/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java index c22383d2b9..6e5af08bb6 100644 --- a/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java +++ b/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java @@ -5,7 +5,7 @@ import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/tds/src/integrationTests/java/thredds/server/ncss/NcssGridIntegrationTest.java b/tds/src/integrationTests/java/thredds/server/ncss/NcssGridIntegrationTest.java index 41b4fe54ad..e38779eead 100644 --- a/tds/src/integrationTests/java/thredds/server/ncss/NcssGridIntegrationTest.java +++ b/tds/src/integrationTests/java/thredds/server/ncss/NcssGridIntegrationTest.java @@ -6,7 +6,7 @@ package thredds.server.ncss; import java.util.Optional; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/tds/src/integrationTests/java/thredds/server/ncss/TestNcssGridWithSwappedDimensions.java b/tds/src/integrationTests/java/thredds/server/ncss/TestNcssGridWithSwappedDimensions.java index b239d940cd..36df252d97 100644 --- a/tds/src/integrationTests/java/thredds/server/ncss/TestNcssGridWithSwappedDimensions.java +++ b/tds/src/integrationTests/java/thredds/server/ncss/TestNcssGridWithSwappedDimensions.java @@ -5,7 +5,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/tds/src/integrationTests/java/thredds/server/notebook/TestNotebookServices.java b/tds/src/integrationTests/java/thredds/server/notebook/TestNotebookServices.java index 4f84f3626e..83c7aa8152 100644 --- a/tds/src/integrationTests/java/thredds/server/notebook/TestNotebookServices.java +++ b/tds/src/integrationTests/java/thredds/server/notebook/TestNotebookServices.java @@ -3,7 +3,7 @@ import static com.google.common.truth.Truth.assertThat; import java.nio.charset.StandardCharsets; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import org.junit.experimental.categories.Category; import thredds.test.util.TestOnLocalServer; diff --git a/tds/src/integrationTests/java/thredds/server/services/TestEnhancements.java b/tds/src/integrationTests/java/thredds/server/services/TestEnhancements.java index 050553ebf1..48e76dcdc3 100644 --- a/tds/src/integrationTests/java/thredds/server/services/TestEnhancements.java +++ b/tds/src/integrationTests/java/thredds/server/services/TestEnhancements.java @@ -8,7 +8,7 @@ import ucar.nc2.NetcdfFiles; import ucar.nc2.Variable; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import ucar.nc2.dataset.NetcdfDatasets; diff --git a/tds/src/integrationTests/java/thredds/server/wms/TestUpdateWmsServer.java b/tds/src/integrationTests/java/thredds/server/wms/TestUpdateWmsServer.java index 2dbbe53274..629cfd8634 100644 --- a/tds/src/integrationTests/java/thredds/server/wms/TestUpdateWmsServer.java +++ b/tds/src/integrationTests/java/thredds/server/wms/TestUpdateWmsServer.java @@ -11,7 +11,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; diff --git a/tds/src/integrationTests/java/thredds/server/wms/TestWmsServer.java b/tds/src/integrationTests/java/thredds/server/wms/TestWmsServer.java index e0680829a5..ac4da86813 100644 --- a/tds/src/integrationTests/java/thredds/server/wms/TestWmsServer.java +++ b/tds/src/integrationTests/java/thredds/server/wms/TestWmsServer.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.concurrent.*; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; diff --git a/tds/src/integrationTests/java/thredds/tds/TestS3Ncml.java b/tds/src/integrationTests/java/thredds/tds/TestS3Ncml.java index ebf52f40af..7692411cd5 100644 --- a/tds/src/integrationTests/java/thredds/tds/TestS3Ncml.java +++ b/tds/src/integrationTests/java/thredds/tds/TestS3Ncml.java @@ -3,7 +3,7 @@ import static com.google.common.truth.Truth.assertThat; import java.nio.charset.StandardCharsets; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import thredds.test.util.TestOnLocalServer; diff --git a/tds/src/integrationTests/java/thredds/tds/TestZarr.java b/tds/src/integrationTests/java/thredds/tds/TestZarr.java index d296de7a80..257ecc953f 100644 --- a/tds/src/integrationTests/java/thredds/tds/TestZarr.java +++ b/tds/src/integrationTests/java/thredds/tds/TestZarr.java @@ -3,7 +3,7 @@ import static com.google.common.truth.Truth.assertThat; import java.nio.charset.StandardCharsets; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import thredds.test.util.TestOnLocalServer; diff --git a/tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java b/tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java index 87fc7b7110..3ce492d879 100644 --- a/tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java +++ b/tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java @@ -21,8 +21,8 @@ import ucar.nc2.units.DateType; import ucar.unidata.util.Format; import ucar.unidata.util.StringUtil2; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.net.URI; diff --git a/tds/src/main/java/thredds/core/DatasetManager.java b/tds/src/main/java/thredds/core/DatasetManager.java index aaaeca3911..dd8b4d95ae 100644 --- a/tds/src/main/java/thredds/core/DatasetManager.java +++ b/tds/src/main/java/thredds/core/DatasetManager.java @@ -40,8 +40,8 @@ import ucar.nc2.internal.ncml.NcmlReader; import ucar.nc2.util.Optional; import ucar.nc2.util.cache.FileFactory; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.FileNotFoundException; import java.io.IOException; import java.io.StringReader; diff --git a/tds/src/main/java/thredds/core/TdsRequestedDataset.java b/tds/src/main/java/thredds/core/TdsRequestedDataset.java index 85bd35726a..e90784fce3 100644 --- a/tds/src/main/java/thredds/core/TdsRequestedDataset.java +++ b/tds/src/main/java/thredds/core/TdsRequestedDataset.java @@ -16,8 +16,8 @@ import ucar.nc2.ft.FeatureDatasetPoint; import ucar.nc2.ft2.coverage.CoverageCollection; import ucar.nc2.ft2.simpgeometry.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/tds/src/main/java/thredds/server/TdsErrorHandling.java b/tds/src/main/java/thredds/server/TdsErrorHandling.java index 50bc975d77..44df863de7 100644 --- a/tds/src/main/java/thredds/server/TdsErrorHandling.java +++ b/tds/src/main/java/thredds/server/TdsErrorHandling.java @@ -20,8 +20,8 @@ import thredds.server.exception.RequestTooLargeException; import thredds.server.exception.ServiceNotAllowed; import thredds.server.ncss.exception.NcssException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; diff --git a/tds/src/main/java/thredds/server/admin/AdminCollectionController.java b/tds/src/main/java/thredds/server/admin/AdminCollectionController.java index bef65ef88a..6c62c3ebb7 100644 --- a/tds/src/main/java/thredds/server/admin/AdminCollectionController.java +++ b/tds/src/main/java/thredds/server/admin/AdminCollectionController.java @@ -9,8 +9,8 @@ import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import com.coverity.security.Escape; import com.google.common.escape.Escaper; import com.google.common.eventbus.EventBus; diff --git a/tds/src/main/java/thredds/server/admin/AdminDebugController.java b/tds/src/main/java/thredds/server/admin/AdminDebugController.java index 899ac6ad24..58ac0c53a1 100644 --- a/tds/src/main/java/thredds/server/admin/AdminDebugController.java +++ b/tds/src/main/java/thredds/server/admin/AdminDebugController.java @@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import thredds.util.ContentType; import ucar.nc2.constants.CDM; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; diff --git a/tds/src/main/java/thredds/server/admin/AdminDirDisplayController.java b/tds/src/main/java/thredds/server/admin/AdminDirDisplayController.java index fca2c9ba5c..900289d720 100644 --- a/tds/src/main/java/thredds/server/admin/AdminDirDisplayController.java +++ b/tds/src/main/java/thredds/server/admin/AdminDirDisplayController.java @@ -6,8 +6,8 @@ import java.io.File; import java.io.FileNotFoundException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/tds/src/main/java/thredds/server/admin/AdminLogController.java b/tds/src/main/java/thredds/server/admin/AdminLogController.java index 7d1eafaf48..42204abf85 100644 --- a/tds/src/main/java/thredds/server/admin/AdminLogController.java +++ b/tds/src/main/java/thredds/server/admin/AdminLogController.java @@ -7,8 +7,8 @@ import java.io.*; import java.util.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; diff --git a/tds/src/main/java/thredds/server/admin/DebugCommands.java b/tds/src/main/java/thredds/server/admin/DebugCommands.java index 9b67751af2..bb86bdac24 100644 --- a/tds/src/main/java/thredds/server/admin/DebugCommands.java +++ b/tds/src/main/java/thredds/server/admin/DebugCommands.java @@ -16,8 +16,8 @@ import java.io.ByteArrayOutputStream; import java.util.*; import java.io.PrintStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import ucar.nc2.dataset.NetcdfDatasets; import ucar.nc2.grib.collection.GribCdmIndex; import ucar.nc2.util.cache.FileCacheIF; diff --git a/tds/src/main/java/thredds/server/admin/HtmlWriting.java b/tds/src/main/java/thredds/server/admin/HtmlWriting.java index b2fe70d217..7e280f4fa8 100644 --- a/tds/src/main/java/thredds/server/admin/HtmlWriting.java +++ b/tds/src/main/java/thredds/server/admin/HtmlWriting.java @@ -10,7 +10,7 @@ import thredds.server.config.TdsContext; import thredds.util.ContentType; import ucar.nc2.time.CalendarDate; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; import java.io.PrintWriter; diff --git a/tds/src/main/java/thredds/server/catalogservice/CatalogServiceController.java b/tds/src/main/java/thredds/server/catalogservice/CatalogServiceController.java index e580f25b7a..df45234f0d 100644 --- a/tds/src/main/java/thredds/server/catalogservice/CatalogServiceController.java +++ b/tds/src/main/java/thredds/server/catalogservice/CatalogServiceController.java @@ -9,8 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import thredds.client.catalog.Catalog; import thredds.client.catalog.Dataset; import thredds.core.CatalogManager; diff --git a/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java b/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java index 0ee70acd96..649bc765e4 100644 --- a/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java +++ b/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java @@ -21,7 +21,7 @@ import ucar.unidata.geoloc.LatLonRect; import ucar.unidata.util.Format; import ucar.unidata.util.StringUtil2; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.net.URI; import java.util.*; import java.util.stream.Collectors; diff --git a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java index df728cb673..3902576936 100644 --- a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java +++ b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java @@ -24,8 +24,8 @@ import thredds.server.config.HtmlConfigBean; import thredds.server.config.TdsContext; import thredds.server.exception.ServiceNotAllowed; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.net.URI; import java.util.Formatter; diff --git a/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java b/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java index b7432dca97..e32bc2551b 100644 --- a/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java +++ b/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java @@ -34,8 +34,8 @@ import ucar.nc2.constants.FeatureType; import ucar.nc2.ft.FeatureDatasetFactoryManager; import ucar.nc2.stream.NcStreamWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.io.OutputStream; diff --git a/tds/src/main/java/thredds/server/config/TdsContext.java b/tds/src/main/java/thredds/server/config/TdsContext.java index 9542171868..2da087f666 100644 --- a/tds/src/main/java/thredds/server/config/TdsContext.java +++ b/tds/src/main/java/thredds/server/config/TdsContext.java @@ -19,8 +19,8 @@ import thredds.util.filesource.FileSource; import ucar.nc2.util.IO; import ucar.unidata.util.StringUtil2; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; import java.io.File; import java.io.IOException; import java.util.Formatter; diff --git a/tds/src/main/java/thredds/server/dap4/Dap4Controller.java b/tds/src/main/java/thredds/server/dap4/Dap4Controller.java index b1ac877e23..cc8cf1bd6f 100644 --- a/tds/src/main/java/thredds/server/dap4/Dap4Controller.java +++ b/tds/src/main/java/thredds/server/dap4/Dap4Controller.java @@ -17,8 +17,8 @@ import thredds.core.TdsRequestedDataset; import thredds.server.config.TdsContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; @Controller diff --git a/tds/src/main/java/thredds/server/fileserver/FileServerController.java b/tds/src/main/java/thredds/server/fileserver/FileServerController.java index eae1055d5b..dc9becf8b9 100644 --- a/tds/src/main/java/thredds/server/fileserver/FileServerController.java +++ b/tds/src/main/java/thredds/server/fileserver/FileServerController.java @@ -10,9 +10,9 @@ import thredds.core.TdsRequestedDataset; import thredds.servlet.ServletUtil; import thredds.util.TdsPathUtils; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/server/metadata/MetadataController.java b/tds/src/main/java/thredds/server/metadata/MetadataController.java index aa8f2463e5..b646d8b6d4 100644 --- a/tds/src/main/java/thredds/server/metadata/MetadataController.java +++ b/tds/src/main/java/thredds/server/metadata/MetadataController.java @@ -26,8 +26,8 @@ import thredds.util.TdsPathUtils; import ucar.nc2.NetcdfFile; import ucar.nc2.dt.GridDataset; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.util.Formatter; import java.util.List; diff --git a/tds/src/main/java/thredds/server/ncss/controller/AbstractNcssController.java b/tds/src/main/java/thredds/server/ncss/controller/AbstractNcssController.java index 1c1304258a..7dc4c616d4 100644 --- a/tds/src/main/java/thredds/server/ncss/controller/AbstractNcssController.java +++ b/tds/src/main/java/thredds/server/ncss/controller/AbstractNcssController.java @@ -21,8 +21,8 @@ import thredds.server.ncss.format.SupportedFormat; import thredds.server.ncss.format.SupportedOperation; import thredds.util.TdsPathUtils; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; diff --git a/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java b/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java index 97fc9ce7af..21ed7f1376 100644 --- a/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java +++ b/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java @@ -37,8 +37,8 @@ import ucar.nc2.ft2.coverage.writer.CoverageAsPoint; import ucar.nc2.ft2.coverage.writer.CoverageDatasetCapabilities; import ucar.nc2.util.IO; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.File; import java.io.IOException; diff --git a/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java b/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java index ed5e6d29f3..a0afe344f1 100644 --- a/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java +++ b/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java @@ -41,8 +41,8 @@ import ucar.nc2.time.CalendarDateRange; import ucar.unidata.geoloc.LatLonPoint; import ucar.unidata.geoloc.LatLonRect; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.Formatter; diff --git a/tds/src/main/java/thredds/server/ncss/view/dsg/DsgSubsetWriter.java b/tds/src/main/java/thredds/server/ncss/view/dsg/DsgSubsetWriter.java index c687643c70..06ba3ae526 100644 --- a/tds/src/main/java/thredds/server/ncss/view/dsg/DsgSubsetWriter.java +++ b/tds/src/main/java/thredds/server/ncss/view/dsg/DsgSubsetWriter.java @@ -15,7 +15,7 @@ import ucar.nc2.time.CalendarDate; import ucar.nc2.time.CalendarDateRange; import ucar.nc2.time.CalendarPeriod; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.util.*; /** diff --git a/tds/src/main/java/thredds/server/notebook/JupyterNotebookViewerService.java b/tds/src/main/java/thredds/server/notebook/JupyterNotebookViewerService.java index 0b2b714100..4e38c23370 100644 --- a/tds/src/main/java/thredds/server/notebook/JupyterNotebookViewerService.java +++ b/tds/src/main/java/thredds/server/notebook/JupyterNotebookViewerService.java @@ -10,7 +10,7 @@ import thredds.server.viewer.ViewerService; import thredds.util.StringValidateEncodeUtils; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; diff --git a/tds/src/main/java/thredds/server/notebook/NotebookController.java b/tds/src/main/java/thredds/server/notebook/NotebookController.java index 176a4bf8f5..5fd256dd19 100644 --- a/tds/src/main/java/thredds/server/notebook/NotebookController.java +++ b/tds/src/main/java/thredds/server/notebook/NotebookController.java @@ -18,8 +18,8 @@ import thredds.server.config.TdsContext; import thredds.server.exception.ServiceNotAllowed; import thredds.util.Constants; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.*; import java.net.URI; diff --git a/tds/src/main/java/thredds/server/opendap/GetHTMLInterfaceHandler2.java b/tds/src/main/java/thredds/server/opendap/GetHTMLInterfaceHandler2.java index 69ba500909..fa053a36f7 100644 --- a/tds/src/main/java/thredds/server/opendap/GetHTMLInterfaceHandler2.java +++ b/tds/src/main/java/thredds/server/opendap/GetHTMLInterfaceHandler2.java @@ -16,8 +16,8 @@ import opendap.servlet.www.wwwFactory; import opendap.servlet.www.wwwOutPut; import thredds.server.config.ThreddsConfig; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.*; /** diff --git a/tds/src/main/java/thredds/server/opendap/OpendapServlet.java b/tds/src/main/java/thredds/server/opendap/OpendapServlet.java index a042e627c6..733e88bb08 100644 --- a/tds/src/main/java/thredds/server/opendap/OpendapServlet.java +++ b/tds/src/main/java/thredds/server/opendap/OpendapServlet.java @@ -6,10 +6,10 @@ package thredds.server.opendap; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; import java.io.*; import java.util.*; import java.util.zip.DeflaterOutputStream; @@ -67,7 +67,7 @@ public class OpendapServlet extends AbstractServlet implements InitializingBean private boolean debugSession = false; @Override - public void afterPropertiesSet() throws javax.servlet.ServletException { + public void afterPropertiesSet() throws jakarta.servlet.ServletException { // Nothing to set at this point in the startup process // This is before TdsInit.onApplicationEvent is called } diff --git a/tds/src/main/java/thredds/server/opendap/OpendapSessionAttributeListener.java b/tds/src/main/java/thredds/server/opendap/OpendapSessionAttributeListener.java index 1f41650f83..222879c675 100644 --- a/tds/src/main/java/thredds/server/opendap/OpendapSessionAttributeListener.java +++ b/tds/src/main/java/thredds/server/opendap/OpendapSessionAttributeListener.java @@ -5,8 +5,8 @@ package thredds.server.opendap; import opendap.servlet.GuardedDataset; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionBindingEvent; +import jakarta.servlet.http.HttpSessionAttributeListener; +import jakarta.servlet.http.HttpSessionBindingEvent; public class OpendapSessionAttributeListener implements HttpSessionAttributeListener { // static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(OpendapSessionAttributeListener.class); diff --git a/tds/src/main/java/thredds/server/radarServer2/RadarServerController.java b/tds/src/main/java/thredds/server/radarServer2/RadarServerController.java index 92d56eb08d..5cc1dc197f 100644 --- a/tds/src/main/java/thredds/server/radarServer2/RadarServerController.java +++ b/tds/src/main/java/thredds/server/radarServer2/RadarServerController.java @@ -42,7 +42,7 @@ import ucar.nc2.units.DateType; import ucar.nc2.units.TimeDuration; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * Serve up radar data in a way that makes it easy to query. Relevant query diff --git a/tds/src/main/java/thredds/server/root/RootController.java b/tds/src/main/java/thredds/server/root/RootController.java index 3f740ba99e..7740f51d95 100644 --- a/tds/src/main/java/thredds/server/root/RootController.java +++ b/tds/src/main/java/thredds/server/root/RootController.java @@ -12,9 +12,9 @@ import thredds.server.config.TdsContext; import thredds.util.RequestForwardUtils; import thredds.util.TdsPathUtils; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; diff --git a/tds/src/main/java/thredds/server/root/TestController.java b/tds/src/main/java/thredds/server/root/TestController.java index 40a1bad13e..32f7f0f780 100644 --- a/tds/src/main/java/thredds/server/root/TestController.java +++ b/tds/src/main/java/thredds/server/root/TestController.java @@ -5,8 +5,8 @@ package thredds.server.root; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.ResponseBody; import thredds.servlet.ServletUtil; diff --git a/tds/src/main/java/thredds/server/viewer/Viewer.java b/tds/src/main/java/thredds/server/viewer/Viewer.java index 37464f89af..61e36b3b0a 100644 --- a/tds/src/main/java/thredds/server/viewer/Viewer.java +++ b/tds/src/main/java/thredds/server/viewer/Viewer.java @@ -5,7 +5,7 @@ package thredds.server.viewer; import thredds.client.catalog.Dataset; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * Interface for plugging in Viewers. diff --git a/tds/src/main/java/thredds/server/viewer/ViewerController.java b/tds/src/main/java/thredds/server/viewer/ViewerController.java index 03cffc26a5..a7ad36a1a4 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerController.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerController.java @@ -8,8 +8,8 @@ import java.io.File; import java.io.IOException; import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/tds/src/main/java/thredds/server/viewer/ViewerLinkProvider.java b/tds/src/main/java/thredds/server/viewer/ViewerLinkProvider.java index c4189981ec..62ffd01ca7 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerLinkProvider.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerLinkProvider.java @@ -5,7 +5,7 @@ package thredds.server.viewer; import thredds.client.catalog.Dataset; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.List; /** diff --git a/tds/src/main/java/thredds/server/viewer/ViewerService.java b/tds/src/main/java/thredds/server/viewer/ViewerService.java index 4c3a3f1bca..53a5050799 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerService.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerService.java @@ -7,7 +7,7 @@ import java.util.Formatter; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import thredds.client.catalog.Dataset; public interface ViewerService { diff --git a/tds/src/main/java/thredds/server/viewer/ViewerServiceImpl.java b/tds/src/main/java/thredds/server/viewer/ViewerServiceImpl.java index 4a3f120088..4d6035ba13 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerServiceImpl.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerServiceImpl.java @@ -12,7 +12,7 @@ import java.util.Formatter; import java.util.HashMap; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; diff --git a/tds/src/main/java/thredds/server/views/FileView.java b/tds/src/main/java/thredds/server/views/FileView.java index ea67ebc586..16b3afc3e3 100644 --- a/tds/src/main/java/thredds/server/views/FileView.java +++ b/tds/src/main/java/thredds/server/views/FileView.java @@ -5,9 +5,9 @@ package thredds.server.views; import org.springframework.web.servlet.view.AbstractView; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletOutputStream; import java.util.Map; import java.io.File; import thredds.util.ContentType; diff --git a/tds/src/main/java/thredds/server/views/InvCatalogXmlView.java b/tds/src/main/java/thredds/server/views/InvCatalogXmlView.java index 70b9cac08e..0a5615452b 100644 --- a/tds/src/main/java/thredds/server/views/InvCatalogXmlView.java +++ b/tds/src/main/java/thredds/server/views/InvCatalogXmlView.java @@ -7,8 +7,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.servlet.view.AbstractView; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.util.Map; import java.io.OutputStream; import thredds.client.catalog.Catalog; diff --git a/tds/src/main/java/thredds/server/views/XmlView.java b/tds/src/main/java/thredds/server/views/XmlView.java index e5bed3cf1b..3ebfb6a104 100644 --- a/tds/src/main/java/thredds/server/views/XmlView.java +++ b/tds/src/main/java/thredds/server/views/XmlView.java @@ -6,8 +6,8 @@ import org.jdom2.output.XMLOutputter; import org.springframework.web.servlet.view.AbstractView; import thredds.util.ContentType; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.util.Map; /** diff --git a/tds/src/main/java/thredds/server/views/XsltForHtmlView.java b/tds/src/main/java/thredds/server/views/XsltForHtmlView.java index 3b304a5f89..ab698fb093 100644 --- a/tds/src/main/java/thredds/server/views/XsltForHtmlView.java +++ b/tds/src/main/java/thredds/server/views/XsltForHtmlView.java @@ -14,8 +14,8 @@ import org.springframework.web.servlet.view.AbstractView; import thredds.server.config.TdsContext; import thredds.util.ContentType; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; diff --git a/tds/src/main/java/thredds/server/wcs/VersionHandler.java b/tds/src/main/java/thredds/server/wcs/VersionHandler.java index 230a0b23e9..ec4031681a 100644 --- a/tds/src/main/java/thredds/server/wcs/VersionHandler.java +++ b/tds/src/main/java/thredds/server/wcs/VersionHandler.java @@ -5,10 +5,10 @@ package thredds.server.wcs; import ucar.nc2.util.DiskCache2; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/server/wcs/WCSController.java b/tds/src/main/java/thredds/server/wcs/WCSController.java index 400bf5d5f3..ce7e6f15d4 100644 --- a/tds/src/main/java/thredds/server/wcs/WCSController.java +++ b/tds/src/main/java/thredds/server/wcs/WCSController.java @@ -14,8 +14,8 @@ import thredds.server.config.ThreddsConfig; import thredds.servlet.*; import java.io.*; -import javax.servlet.*; -import javax.servlet.http.*; +import jakarta.servlet.*; +import jakarta.servlet.http.*; import ucar.nc2.util.DiskCache2; /** @@ -41,7 +41,7 @@ public enum Operation { } @Override - public void afterPropertiesSet() throws javax.servlet.ServletException { + public void afterPropertiesSet() throws jakarta.servlet.ServletException { // Nothing to set at this point in the startup process // This is before TdsInit.onApplicationEvent is called } diff --git a/tds/src/main/java/thredds/server/wcs/WcsHandler.java b/tds/src/main/java/thredds/server/wcs/WcsHandler.java index 2922556b95..ee79dc8aaf 100644 --- a/tds/src/main/java/thredds/server/wcs/WcsHandler.java +++ b/tds/src/main/java/thredds/server/wcs/WcsHandler.java @@ -6,9 +6,9 @@ import thredds.servlet.ServletUtil; import thredds.util.ContentType; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.io.File; diff --git a/tds/src/main/java/thredds/server/wcs/WcsRequestParser.java b/tds/src/main/java/thredds/server/wcs/WcsRequestParser.java index 48f14df80c..239ed3b149 100644 --- a/tds/src/main/java/thredds/server/wcs/WcsRequestParser.java +++ b/tds/src/main/java/thredds/server/wcs/WcsRequestParser.java @@ -6,8 +6,8 @@ import thredds.core.TdsRequestedDataset; import thredds.servlet.ServletUtil; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import ucar.nc2.ft2.coverage.*; import ucar.nc2.time.CalendarDate; import ucar.nc2.time.CalendarDateRange; diff --git a/tds/src/main/java/thredds/server/wfs/WFSController.java b/tds/src/main/java/thredds/server/wfs/WFSController.java index e6357192d9..75fe8bdcbc 100644 --- a/tds/src/main/java/thredds/server/wfs/WFSController.java +++ b/tds/src/main/java/thredds/server/wfs/WFSController.java @@ -16,9 +16,9 @@ import java.util.Enumeration; import java.util.LinkedList; import java.util.List; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * Controller for WFS Simple Geometry Web Service diff --git a/tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java b/tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java index 33c02bb669..21782fb912 100644 --- a/tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java +++ b/tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java @@ -2,7 +2,7 @@ import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; /** * A simple XML writer for XML-based WFS exceptions. diff --git a/tds/src/main/java/thredds/server/wms/Godiva3Viewer.java b/tds/src/main/java/thredds/server/wms/Godiva3Viewer.java index b0e323851e..c31cbd6432 100644 --- a/tds/src/main/java/thredds/server/wms/Godiva3Viewer.java +++ b/tds/src/main/java/thredds/server/wms/Godiva3Viewer.java @@ -32,7 +32,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URLEncoder; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import thredds.client.catalog.Access; diff --git a/tds/src/main/java/thredds/server/wms/ThreddsWmsServlet.java b/tds/src/main/java/thredds/server/wms/ThreddsWmsServlet.java index 057b6c6e4d..f8091e14f7 100644 --- a/tds/src/main/java/thredds/server/wms/ThreddsWmsServlet.java +++ b/tds/src/main/java/thredds/server/wms/ThreddsWmsServlet.java @@ -47,8 +47,8 @@ import uk.ac.rdg.resc.edal.wms.WmsCatalogue; import uk.ac.rdg.resc.edal.wms.WmsServlet; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import thredds.core.TdsRequestedDataset; import ucar.nc2.NetcdfFile; import ucar.nc2.dataset.NetcdfDataset; diff --git a/tds/src/main/java/thredds/servlet/DatasetSource.java b/tds/src/main/java/thredds/servlet/DatasetSource.java index 5519db0153..86206e1cac 100644 --- a/tds/src/main/java/thredds/servlet/DatasetSource.java +++ b/tds/src/main/java/thredds/servlet/DatasetSource.java @@ -6,8 +6,8 @@ package thredds.servlet; import ucar.nc2.NetcdfFile; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/ServletUtil.java b/tds/src/main/java/thredds/servlet/ServletUtil.java index 30aecfc505..506fd3aac4 100644 --- a/tds/src/main/java/thredds/servlet/ServletUtil.java +++ b/tds/src/main/java/thredds/servlet/ServletUtil.java @@ -6,7 +6,7 @@ package thredds.servlet; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import thredds.core.ConfigCatalogHtmlWriter; import thredds.core.TdsRequestedDataset; import thredds.inventory.MFile; @@ -16,12 +16,12 @@ import ucar.nc2.util.EscapeStrings; import ucar.nc2.util.IO; import ucar.unidata.io.RandomAccessFile; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import java.io.*; import java.net.URI; import java.net.URISyntaxException; diff --git a/tds/src/main/java/thredds/servlet/UsageLog.java b/tds/src/main/java/thredds/servlet/UsageLog.java index 5ac22ff8cf..0fbdccce3c 100644 --- a/tds/src/main/java/thredds/servlet/UsageLog.java +++ b/tds/src/main/java/thredds/servlet/UsageLog.java @@ -6,7 +6,7 @@ package thredds.servlet; import org.slf4j.MDC; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.Formatter; import java.util.concurrent.atomic.AtomicLong; diff --git a/tds/src/main/java/thredds/servlet/filter/CookieFilter.java b/tds/src/main/java/thredds/servlet/filter/CookieFilter.java index e208faa69e..3fe1318dc4 100644 --- a/tds/src/main/java/thredds/servlet/filter/CookieFilter.java +++ b/tds/src/main/java/thredds/servlet/filter/CookieFilter.java @@ -5,8 +5,8 @@ package thredds.servlet.filter; -import javax.servlet.*; -import javax.servlet.http.*; +import jakarta.servlet.*; +import jakarta.servlet.http.*; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/filter/HttpHeadFilter.java b/tds/src/main/java/thredds/servlet/filter/HttpHeadFilter.java index 098b4bc76e..206ea85fd2 100644 --- a/tds/src/main/java/thredds/servlet/filter/HttpHeadFilter.java +++ b/tds/src/main/java/thredds/servlet/filter/HttpHeadFilter.java @@ -12,11 +12,11 @@ */ package thredds.servlet.filter; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; diff --git a/tds/src/main/java/thredds/servlet/filter/RequestBracketingLogMessageFilter.java b/tds/src/main/java/thredds/servlet/filter/RequestBracketingLogMessageFilter.java index 69df49830b..88f3a15b13 100644 --- a/tds/src/main/java/thredds/servlet/filter/RequestBracketingLogMessageFilter.java +++ b/tds/src/main/java/thredds/servlet/filter/RequestBracketingLogMessageFilter.java @@ -7,9 +7,9 @@ import org.slf4j.MDC; import thredds.servlet.UsageLog; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** @@ -18,7 +18,7 @@ * @author edavis * @since 4.1 */ -public class RequestBracketingLogMessageFilter implements javax.servlet.Filter { +public class RequestBracketingLogMessageFilter implements jakarta.servlet.Filter { private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("threddsServlet"); diff --git a/tds/src/main/java/thredds/servlet/filter/RequestPathFilter.java b/tds/src/main/java/thredds/servlet/filter/RequestPathFilter.java index 366b6a2286..3b4be452c8 100644 --- a/tds/src/main/java/thredds/servlet/filter/RequestPathFilter.java +++ b/tds/src/main/java/thredds/servlet/filter/RequestPathFilter.java @@ -8,9 +8,9 @@ import thredds.servlet.ServletUtil; import thredds.util.StringValidateEncodeUtils; import thredds.util.TdsPathUtils; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** @@ -31,7 +31,7 @@ * @see thredds.util.StringValidateEncodeUtils#validPath(String) * @since 3.16.47 */ -public class RequestPathFilter implements javax.servlet.Filter { +public class RequestPathFilter implements jakarta.servlet.Filter { private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(getClass()); public void init(FilterConfig filterConfig) throws ServletException {} diff --git a/tds/src/main/java/thredds/servlet/filter/RequestQueryFilter.java b/tds/src/main/java/thredds/servlet/filter/RequestQueryFilter.java index f21f7d0b88..1f8c001781 100644 --- a/tds/src/main/java/thredds/servlet/filter/RequestQueryFilter.java +++ b/tds/src/main/java/thredds/servlet/filter/RequestQueryFilter.java @@ -5,9 +5,9 @@ package thredds.servlet.filter; import thredds.util.StringValidateEncodeUtils; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLDecoder; diff --git a/tds/src/main/java/thredds/servlet/filter/TdsServletResponseWrapper.java b/tds/src/main/java/thredds/servlet/filter/TdsServletResponseWrapper.java index 192ca398c2..c5afe18091 100644 --- a/tds/src/main/java/thredds/servlet/filter/TdsServletResponseWrapper.java +++ b/tds/src/main/java/thredds/servlet/filter/TdsServletResponseWrapper.java @@ -5,8 +5,8 @@ package thredds.servlet.filter; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/restrict/Authorizer.java b/tds/src/main/java/thredds/servlet/restrict/Authorizer.java index e26f50aced..e4e2d21ad2 100644 --- a/tds/src/main/java/thredds/servlet/restrict/Authorizer.java +++ b/tds/src/main/java/thredds/servlet/restrict/Authorizer.java @@ -5,10 +5,10 @@ package thredds.servlet.restrict; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.ServletException; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/restrict/AuthorizerNoop.java b/tds/src/main/java/thredds/servlet/restrict/AuthorizerNoop.java index c869183d4e..13e654f70a 100644 --- a/tds/src/main/java/thredds/servlet/restrict/AuthorizerNoop.java +++ b/tds/src/main/java/thredds/servlet/restrict/AuthorizerNoop.java @@ -4,9 +4,9 @@ */ package thredds.servlet.restrict; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/restrict/CAMSAuthorizer.java b/tds/src/main/java/thredds/servlet/restrict/CAMSAuthorizer.java index a6a3801187..573b642b4b 100644 --- a/tds/src/main/java/thredds/servlet/restrict/CAMSAuthorizer.java +++ b/tds/src/main/java/thredds/servlet/restrict/CAMSAuthorizer.java @@ -5,10 +5,10 @@ package thredds.servlet.restrict; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.ServletException; import java.io.IOException; import java.util.List; import java.util.ArrayList; diff --git a/tds/src/main/java/thredds/servlet/restrict/RestrictedAccessController.java b/tds/src/main/java/thredds/servlet/restrict/RestrictedAccessController.java index 2e487ac8ea..50d7af28aa 100644 --- a/tds/src/main/java/thredds/servlet/restrict/RestrictedAccessController.java +++ b/tds/src/main/java/thredds/servlet/restrict/RestrictedAccessController.java @@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import thredds.servlet.ServletUtil; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/servlet/restrict/TomcatAuthorizer.java b/tds/src/main/java/thredds/servlet/restrict/TomcatAuthorizer.java index 238d363c8d..c998bc4ee1 100644 --- a/tds/src/main/java/thredds/servlet/restrict/TomcatAuthorizer.java +++ b/tds/src/main/java/thredds/servlet/restrict/TomcatAuthorizer.java @@ -5,10 +5,10 @@ package thredds.servlet.restrict; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.ServletException; import java.io.IOException; import org.springframework.beans.factory.annotation.Autowired; import thredds.server.config.TdsContext; diff --git a/tds/src/main/java/thredds/util/RequestForwardUtils.java b/tds/src/main/java/thredds/util/RequestForwardUtils.java index e66c447bbf..c813deb7bc 100644 --- a/tds/src/main/java/thredds/util/RequestForwardUtils.java +++ b/tds/src/main/java/thredds/util/RequestForwardUtils.java @@ -7,11 +7,11 @@ import com.google.common.escape.Escaper; import com.google.common.net.UrlEscapers; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; /** diff --git a/tds/src/main/java/thredds/util/TdsPathUtils.java b/tds/src/main/java/thredds/util/TdsPathUtils.java index 8240b79ebf..52d6ded374 100644 --- a/tds/src/main/java/thredds/util/TdsPathUtils.java +++ b/tds/src/main/java/thredds/util/TdsPathUtils.java @@ -6,7 +6,7 @@ import com.google.common.base.Preconditions; import ucar.nc2.NetcdfFileWriter; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import ucar.nc2.write.NetcdfFileFormat; /** diff --git a/tds/src/test/java/thredds/mock/web/MockTdsServletContext.java b/tds/src/test/java/thredds/mock/web/MockTdsServletContext.java index 2ae00bb717..7d05662f92 100644 --- a/tds/src/test/java/thredds/mock/web/MockTdsServletContext.java +++ b/tds/src/test/java/thredds/mock/web/MockTdsServletContext.java @@ -4,7 +4,7 @@ */ package thredds.mock.web; -import javax.servlet.RequestDispatcher; +import jakarta.servlet.RequestDispatcher; import org.springframework.core.io.ResourceLoader; import org.springframework.mock.web.MockRequestDispatcher; import org.springframework.mock.web.MockServletContext; @@ -71,7 +71,7 @@ public RequestDispatcher getNamedDispatcher(String path) { return new MockRequestDispatcher(path); } - public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor() { + public jakarta.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor() { throw new UnsupportedOperationException(); } diff --git a/tds/src/test/java/thredds/server/catalogservice/TestContext.java b/tds/src/test/java/thredds/server/catalogservice/TestContext.java index b6ec612bc3..220b862efb 100644 --- a/tds/src/test/java/thredds/server/catalogservice/TestContext.java +++ b/tds/src/test/java/thredds/server/catalogservice/TestContext.java @@ -3,7 +3,7 @@ import static com.google.common.truth.Truth.assertThat; import java.lang.invoke.MethodHandles; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.apache.http.HttpStatus; import org.hamcrest.core.StringContains; import org.junit.Before; diff --git a/tds/src/test/java/thredds/server/opendap/OpendapServletTest.java b/tds/src/test/java/thredds/server/opendap/OpendapServletTest.java index 28c446930b..4a99f975b6 100644 --- a/tds/src/test/java/thredds/server/opendap/OpendapServletTest.java +++ b/tds/src/test/java/thredds/server/opendap/OpendapServletTest.java @@ -4,7 +4,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.invoke.MethodHandles; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -20,7 +20,7 @@ import thredds.mock.web.MockTdsContextLoader; import ucar.nc2.constants.CDM; import ucar.unidata.util.test.category.NeedsCdmUnitTest; -import javax.servlet.ServletConfig; +import jakarta.servlet.ServletConfig; @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration diff --git a/tds/src/test/java/thredds/server/root/RootControllerTest.java b/tds/src/test/java/thredds/server/root/RootControllerTest.java index 07dd5ffca6..5a243b678a 100644 --- a/tds/src/test/java/thredds/server/root/RootControllerTest.java +++ b/tds/src/test/java/thredds/server/root/RootControllerTest.java @@ -2,7 +2,7 @@ import static com.google.common.truth.Truth.assertThat; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; diff --git a/tds/src/test/java/thredds/server/serverinfo/ServerInfoControllerTest.java b/tds/src/test/java/thredds/server/serverinfo/ServerInfoControllerTest.java index 042043cc81..769e7f092c 100644 --- a/tds/src/test/java/thredds/server/serverinfo/ServerInfoControllerTest.java +++ b/tds/src/test/java/thredds/server/serverinfo/ServerInfoControllerTest.java @@ -1,6 +1,6 @@ package thredds.server.serverinfo; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/tds/src/test/java/thredds/server/wms/TestWmsCache.java b/tds/src/test/java/thredds/server/wms/TestWmsCache.java index ac6729bb60..9a44a329c1 100644 --- a/tds/src/test/java/thredds/server/wms/TestWmsCache.java +++ b/tds/src/test/java/thredds/server/wms/TestWmsCache.java @@ -10,8 +10,8 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.List; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletResponse; import org.joda.time.DateTime; import org.junit.*; import org.junit.experimental.categories.Category; diff --git a/tds/src/test/java/thredds/servlet/DatasetSourceExample.java b/tds/src/test/java/thredds/servlet/DatasetSourceExample.java index 8a3bd5a399..de59f400ef 100644 --- a/tds/src/test/java/thredds/servlet/DatasetSourceExample.java +++ b/tds/src/test/java/thredds/servlet/DatasetSourceExample.java @@ -1,7 +1,7 @@ package thredds.servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; import thredds.core.DataRootManager; From 2f1154af10908cc61288c5ff3489ef350693d4eb Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 13:41:07 -0600 Subject: [PATCH 04/25] Update to hibernate validator 7 (Jakarta EE 9) and use jakarta namespace --- gradle/any/shared-mvn-coords.gradle | 2 +- .../catalog/tracker/DatasetExtBytesMarshaller.java | 2 +- tds/src/main/java/thredds/core/DataRootManager.java | 2 +- .../server/catalogservice/RemoteCatalogRequest.java | 2 +- .../catalogservice/RemoteCatalogServiceController.java | 2 +- .../thredds/server/cdmremote/CdmRemoteController.java | 2 +- .../thredds/server/metadata/MetadataController.java | 2 +- .../server/metadata/MetadataRequestParameterBean.java | 2 +- .../server/ncss/controller/NcssGridController.java | 2 +- .../server/ncss/controller/NcssPointController.java | 2 +- .../ncss/validation/NcssGridRequestConstraint.java | 4 ++-- .../ncss/validation/NcssGridRequestValidator.java | 6 +++--- .../validation/PointHorizSubsetTypeConstraint.java | 4 ++-- .../ncss/validation/PointHorizSubsetTypeValidator.java | 10 +++++----- .../server/ncss/validation/TimeParamsConstraint.java | 4 ++-- .../server/ncss/validation/TimeParamsValidator.java | 4 ++-- .../server/ncss/validation/VarParamConstraint.java | 4 ++-- .../server/ncss/validation/VarParamsValidator.java | 4 ++-- .../AbstractMixedFeatureTypeSubsetWriter.java | 2 +- .../thredds/server/notebook/NotebookController.java | 2 +- .../java/thredds/server/radarServer2/StationList.java | 8 ++++---- .../java/thredds/server/viewer/ViewerController.java | 2 +- .../thredds/server/viewer/ViewerRequestParamsBean.java | 2 +- .../thredds/server/ncss/validation/TestNcssParams.java | 8 ++++---- .../java/thredds/server/root/RootControllerTest.java | 2 +- 25 files changed, 43 insertions(+), 43 deletions(-) diff --git a/gradle/any/shared-mvn-coords.gradle b/gradle/any/shared-mvn-coords.gradle index 5832888d88..3d0d6caf79 100644 --- a/gradle/any/shared-mvn-coords.gradle +++ b/gradle/any/shared-mvn-coords.gradle @@ -27,7 +27,7 @@ ext { // gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven // coordinates for jakarta.servlet-api if the gradle plugin in applied. If we don't, we see errors like this: depVersion.jakartaServletApi = '5.0.0' - depVersion.hibernateValidator = '6.2.5.Final' + depVersion.hibernateValidator = '7.0.0.Final' // TODO: figure out way to keep this version in sync with netcdf-java version // It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't // reference that version in a gradle build script (see gradle/any/protobuf.gradle) diff --git a/tdcommon/src/main/java/thredds/server/catalog/tracker/DatasetExtBytesMarshaller.java b/tdcommon/src/main/java/thredds/server/catalog/tracker/DatasetExtBytesMarshaller.java index 4839800134..2909338d7e 100644 --- a/tdcommon/src/main/java/thredds/server/catalog/tracker/DatasetExtBytesMarshaller.java +++ b/tdcommon/src/main/java/thredds/server/catalog/tracker/DatasetExtBytesMarshaller.java @@ -5,7 +5,7 @@ import net.openhft.chronicle.core.util.ReadResolvable; import net.openhft.chronicle.hash.serialization.BytesReader; import net.openhft.chronicle.hash.serialization.BytesWriter; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import javax.annotation.Nullable; public class DatasetExtBytesMarshaller diff --git a/tds/src/main/java/thredds/core/DataRootManager.java b/tds/src/main/java/thredds/core/DataRootManager.java index b8345cfb6f..7e8b5eaff5 100644 --- a/tds/src/main/java/thredds/core/DataRootManager.java +++ b/tds/src/main/java/thredds/core/DataRootManager.java @@ -5,7 +5,7 @@ package thredds.core; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; diff --git a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogRequest.java b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogRequest.java index 898be9103b..1941f1d4b5 100644 --- a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogRequest.java +++ b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogRequest.java @@ -4,7 +4,7 @@ */ package thredds.server.catalogservice; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.URI; /** diff --git a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java index 3902576936..a1b28b0de2 100644 --- a/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java +++ b/tds/src/main/java/thredds/server/catalogservice/RemoteCatalogServiceController.java @@ -26,7 +26,7 @@ import thredds.server.exception.ServiceNotAllowed; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.net.URI; import java.util.Formatter; import java.util.HashMap; diff --git a/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java b/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java index e32bc2551b..d0bd1bfd61 100644 --- a/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java +++ b/tds/src/main/java/thredds/server/cdmremote/CdmRemoteController.java @@ -36,7 +36,7 @@ import ucar.nc2.stream.NcStreamWriter; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.IOException; import java.io.OutputStream; import java.util.StringTokenizer; diff --git a/tds/src/main/java/thredds/server/metadata/MetadataController.java b/tds/src/main/java/thredds/server/metadata/MetadataController.java index b646d8b6d4..a021161b09 100644 --- a/tds/src/main/java/thredds/server/metadata/MetadataController.java +++ b/tds/src/main/java/thredds/server/metadata/MetadataController.java @@ -28,7 +28,7 @@ import ucar.nc2.dt.GridDataset; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.Formatter; import java.util.List; diff --git a/tds/src/main/java/thredds/server/metadata/MetadataRequestParameterBean.java b/tds/src/main/java/thredds/server/metadata/MetadataRequestParameterBean.java index d1720abf9e..52baec5210 100644 --- a/tds/src/main/java/thredds/server/metadata/MetadataRequestParameterBean.java +++ b/tds/src/main/java/thredds/server/metadata/MetadataRequestParameterBean.java @@ -5,7 +5,7 @@ package thredds.server.metadata; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; /** * Describe diff --git a/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java b/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java index 21ed7f1376..3a38eb3de5 100644 --- a/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java +++ b/tds/src/main/java/thredds/server/ncss/controller/NcssGridController.java @@ -39,7 +39,7 @@ import ucar.nc2.util.IO; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.File; import java.io.IOException; import java.util.*; diff --git a/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java b/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java index a0afe344f1..fc6c23ce30 100644 --- a/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java +++ b/tds/src/main/java/thredds/server/ncss/controller/NcssPointController.java @@ -43,7 +43,7 @@ import ucar.unidata.geoloc.LatLonRect; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.IOException; import java.util.Formatter; import java.util.HashMap; diff --git a/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestConstraint.java b/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestConstraint.java index baa0477676..4236d85a62 100644 --- a/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestConstraint.java +++ b/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestConstraint.java @@ -5,8 +5,8 @@ package thredds.server.ncss.validation; -import javax.validation.Constraint; -import javax.validation.Payload; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java b/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java index d206bdbfb7..730690ab9f 100644 --- a/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java +++ b/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java @@ -7,8 +7,8 @@ import thredds.server.ncss.params.NcssGridParamsBean; import ucar.nc2.time.CalendarDate; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; /** * {@literal Validator for ncss GridRequest @@ -26,7 +26,7 @@ public class NcssGridRequestValidator implements ConstraintValidator> { diff --git a/tds/src/main/java/thredds/server/ncss/view/dsg/any_point/AbstractMixedFeatureTypeSubsetWriter.java b/tds/src/main/java/thredds/server/ncss/view/dsg/any_point/AbstractMixedFeatureTypeSubsetWriter.java index 6dd16b46d2..ec838ee90b 100644 --- a/tds/src/main/java/thredds/server/ncss/view/dsg/any_point/AbstractMixedFeatureTypeSubsetWriter.java +++ b/tds/src/main/java/thredds/server/ncss/view/dsg/any_point/AbstractMixedFeatureTypeSubsetWriter.java @@ -7,7 +7,7 @@ import ucar.nc2.ft.*; import ucar.nc2.ft2.coverage.SubsetParams; -import javax.validation.constraints.Null; +import jakarta.validation.constraints.Null; import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.io.OutputStream; diff --git a/tds/src/main/java/thredds/server/notebook/NotebookController.java b/tds/src/main/java/thredds/server/notebook/NotebookController.java index 5fd256dd19..ec3bb4aa6c 100644 --- a/tds/src/main/java/thredds/server/notebook/NotebookController.java +++ b/tds/src/main/java/thredds/server/notebook/NotebookController.java @@ -20,7 +20,7 @@ import thredds.util.Constants; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.*; import java.net.URI; import java.net.URISyntaxException; diff --git a/tds/src/main/java/thredds/server/radarServer2/StationList.java b/tds/src/main/java/thredds/server/radarServer2/StationList.java index c492fbc4ae..3f18267d2d 100644 --- a/tds/src/main/java/thredds/server/radarServer2/StationList.java +++ b/tds/src/main/java/thredds/server/radarServer2/StationList.java @@ -10,10 +10,10 @@ import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import ucar.unidata.geoloc.*; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlID; +import jakarta.xml.bind.annotation.XmlRootElement; import java.io.File; import java.io.IOException; import java.util.*; diff --git a/tds/src/main/java/thredds/server/viewer/ViewerController.java b/tds/src/main/java/thredds/server/viewer/ViewerController.java index a7ad36a1a4..958d132968 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerController.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerController.java @@ -10,7 +10,7 @@ import java.util.Enumeration; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/tds/src/main/java/thredds/server/viewer/ViewerRequestParamsBean.java b/tds/src/main/java/thredds/server/viewer/ViewerRequestParamsBean.java index 89eeb0dc7f..9f38bb1871 100644 --- a/tds/src/main/java/thredds/server/viewer/ViewerRequestParamsBean.java +++ b/tds/src/main/java/thredds/server/viewer/ViewerRequestParamsBean.java @@ -5,7 +5,7 @@ package thredds.server.viewer; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class ViewerRequestParamsBean { diff --git a/tds/src/test/java/thredds/server/ncss/validation/TestNcssParams.java b/tds/src/test/java/thredds/server/ncss/validation/TestNcssParams.java index 1d84533af1..e7f7065596 100644 --- a/tds/src/test/java/thredds/server/ncss/validation/TestNcssParams.java +++ b/tds/src/test/java/thredds/server/ncss/validation/TestNcssParams.java @@ -7,10 +7,10 @@ import java.io.InputStream; import java.lang.invoke.MethodHandles; import java.util.*; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; diff --git a/tds/src/test/java/thredds/server/root/RootControllerTest.java b/tds/src/test/java/thredds/server/root/RootControllerTest.java index 5a243b678a..8067a5d6ff 100644 --- a/tds/src/test/java/thredds/server/root/RootControllerTest.java +++ b/tds/src/test/java/thredds/server/root/RootControllerTest.java @@ -19,7 +19,7 @@ import org.springframework.web.context.WebApplicationContext; import thredds.mock.web.MockTdsContextLoader; import ucar.unidata.util.test.category.NeedsContentRoot; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.lang.invoke.MethodHandles; @RunWith(SpringJUnit4ClassRunner.class) From 22d97b8237435d90e74f56e7ed6cb6fd254a3584 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 15:01:30 -0600 Subject: [PATCH 05/25] Update gretty to 4 and tomcat to 10 --- .github/workflows/tds.yml | 3 +-- gradle/any/gretty.gradle | 10 +--------- gradle/any/shared-mvn-coords.gradle | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tds.yml b/.github/workflows/tds.yml index ad73beea37..fb8615c3ec 100644 --- a/.github/workflows/tds.yml +++ b/.github/workflows/tds.yml @@ -8,8 +8,7 @@ jobs: matrix: java-version: [ 17 ] java-vendor: [ 'temurin' ] - # test against tomcat 8.5.x and tomcat 9.x - servletcontainer: [ 'tomcat85', 'tomcat9' ] + servletcontainer: [ 'tomcat10' ] steps: - uses: actions/checkout@v4 - name: Build and test with Gradle (${{ matrix.java-vendor }} ${{ matrix.java-version }}) diff --git a/gradle/any/gretty.gradle b/gradle/any/gretty.gradle index a31a4bce80..2bd0de460c 100644 --- a/gradle/any/gretty.gradle +++ b/gradle/any/gretty.gradle @@ -33,10 +33,9 @@ repositories { } // allow servlet container to be configured by setting a system property -// default to tomcat 8.5.x def servletContainerName = System.getProperty('tds.test.gretty.container') if (servletContainerName == null || servletContainerName.isEmpty()) { - servletContainerName = 'tomcat85' + servletContainerName = 'tomcat10' } import org.akhikhl.gretty.AppBeforeIntegrationTestTask @@ -97,10 +96,3 @@ gretty { } } } - -configurations.runtimeClasspath { - // When gretty uses tomcat 9, javax.servlet-api gets added to the runtimeClasspath of the projects - // to which the plugin is applied. This makes sure we exclude it, which keeps it from getting included - // with our war artifacts. - exclude group: 'javax.servlet', module: 'javax.servlet-api' -} diff --git a/gradle/any/shared-mvn-coords.gradle b/gradle/any/shared-mvn-coords.gradle index 3d0d6caf79..e13ab83d25 100644 --- a/gradle/any/shared-mvn-coords.gradle +++ b/gradle/any/shared-mvn-coords.gradle @@ -5,7 +5,7 @@ ext { // plugin version management buildPlugins = [:] - buildPlugins.gretty = 'org.gretty:gretty:3.0.9' + buildPlugins.gretty = 'org.gretty:gretty:4.1.5' buildPlugins.shadow = 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2' buildPlugins.sonarqube = 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0' buildPlugins.spotless = 'com.diffplug.spotless:spotless-plugin-gradle:4.5.1' From bf14c1ac90488d783127c47e3fff6e3e1b691886 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 10 Jul 2024 15:19:56 -0600 Subject: [PATCH 06/25] Add jvm argument to detect memory leaks --- gradle/any/properties.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/any/properties.gradle b/gradle/any/properties.gradle index d3d56b1558..363d9dbaed 100644 --- a/gradle/any/properties.gradle +++ b/gradle/any/properties.gradle @@ -55,6 +55,7 @@ ext { ext { jvmArguments = [ + '--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED', '--add-exports', 'java.base/jdk.internal.ref=ALL-UNNAMED', '--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED', From a4b32092f2713a1f448144adb17af588dcd0523f Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 11 Jul 2024 09:45:48 -0600 Subject: [PATCH 07/25] Use log4j jarkarta web --- dap4/d4ts/build.gradle | 2 +- opendap/dtswar/build.gradle | 2 +- tds-platform/build.gradle | 4 +++- tds-testing-platform/build.gradle | 2 +- tds/build.gradle | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dap4/d4ts/build.gradle b/dap4/d4ts/build.gradle index ba116d744b..33bde22377 100644 --- a/dap4/d4ts/build.gradle +++ b/dap4/d4ts/build.gradle @@ -13,7 +13,7 @@ dependencies { compileOnly 'org.slf4j:slf4j-api' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl' - runtimeOnly 'org.apache.logging.log4j:log4j-web' + runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-web' compileOnly 'org.slf4j:slf4j-api' } diff --git a/opendap/dtswar/build.gradle b/opendap/dtswar/build.gradle index 9de65c4202..c939c590f2 100644 --- a/opendap/dtswar/build.gradle +++ b/opendap/dtswar/build.gradle @@ -21,5 +21,5 @@ dependencies { runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl' - runtimeOnly 'org.apache.logging.log4j:log4j-web' + runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-web' } diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 61875a72ca..4abc1eaa25 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -18,6 +18,8 @@ dependencies { api enforcedPlatform('org.springframework.security:spring-security-bom:6.3.1') api platform('net.openhft:chronicle-bom:2.25ea62') api enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.17.1") + // remove log4j-jakarta-web and use log4j-jakarta-bom when that is released + api enforcedPlatform("org.apache.logging.log4j:log4j-jakarta-web:2.23.1") api enforcedPlatform("jakarta.platform:jakarta.jakartaee-bom:9.0.0") @@ -79,7 +81,7 @@ dependencies { runtime 'edu.ucar:dap4' // defined in tds-testing-platform as well, but using api config - runtime 'org.apache.logging.log4j:log4j-web' + runtime 'org.apache.logging.log4j:log4j-jakarta-web' // tds api 'org.json:json:20231013' diff --git a/tds-testing-platform/build.gradle b/tds-testing-platform/build.gradle index e12c2b04b3..ae0e275304 100644 --- a/tds-testing-platform/build.gradle +++ b/tds-testing-platform/build.gradle @@ -19,7 +19,7 @@ dependencies { // dap4 // defined in tds-platform as well, but using runtime config - api 'org.apache.logging.log4j:log4j-web' // api because of :dap4:d4tests) + api 'org.apache.logging.log4j:log4j-jakarta-web' // api because of :dap4:d4tests) // tds api "jaxen:jaxen:${depVersion.jaxen}" // api because of XPath operations in mock tests diff --git a/tds/build.gradle b/tds/build.gradle index b678c81857..2ed70133df 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -109,7 +109,7 @@ dependencies { // Logging implementation 'org.slf4j:slf4j-api' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl' - runtimeOnly 'org.apache.logging.log4j:log4j-web' + runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-web' testRuntimeOnly 'ch.qos.logback:logback-classic' // This is for freshInstallTest From 0fb0387bde4c7cb5436dad9d7f8c20e13da479f9 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 11 Jul 2024 09:49:18 -0600 Subject: [PATCH 08/25] Update spring security schema --- tds/src/main/webapp/WEB-INF/applicationContext.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tds/src/main/webapp/WEB-INF/applicationContext.xml b/tds/src/main/webapp/WEB-INF/applicationContext.xml index 23c270e08c..f90ef83975 100644 --- a/tds/src/main/webapp/WEB-INF/applicationContext.xml +++ b/tds/src/main/webapp/WEB-INF/applicationContext.xml @@ -9,7 +9,7 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security-5.7.xsd"> + http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security-6.3.xsd"> From 293953d71bbc2673c0583827c6bd3378104de0bd Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 11 Jul 2024 10:54:17 -0600 Subject: [PATCH 09/25] Use ant path matcher --- tds/src/main/webapp/WEB-INF/applicationContext.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tds/src/main/webapp/WEB-INF/applicationContext.xml b/tds/src/main/webapp/WEB-INF/applicationContext.xml index f90ef83975..886d28a747 100644 --- a/tds/src/main/webapp/WEB-INF/applicationContext.xml +++ b/tds/src/main/webapp/WEB-INF/applicationContext.xml @@ -13,7 +13,12 @@ - + + + + + + From 57e2604f5f082f9db4b03a8a40dbb3e8e264e570 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Mon, 29 Jul 2024 13:52:30 -0600 Subject: [PATCH 10/25] Upgrade to thymeleaf for spring 6 --- tds-platform/build.gradle | 2 +- tds/build.gradle | 2 +- .../thredds/server/views/TdsExtensibleTemplateResolver.java | 2 +- tds/src/main/webapp/WEB-INF/spring-servlet.xml | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 4abc1eaa25..90d9474f82 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -86,7 +86,7 @@ dependencies { // tds api 'org.json:json:20231013' api 'com.coverity.security:coverity-escapers:1.1.1' - api 'org.thymeleaf:thymeleaf-spring5:3.1.2.RELEASE' + api 'org.thymeleaf:thymeleaf-spring6:3.1.2.RELEASE' api 'jakarta.validation:jakarta.validation-api' api "org.hibernate.validator:hibernate-validator:${depVersion.hibernateValidator}" api "org.hibernate.validator:hibernate-validator-annotation-processor:${depVersion.hibernateValidator}" diff --git a/tds/build.gradle b/tds/build.gradle index 2ed70133df..bd3f87b72e 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -91,7 +91,7 @@ dependencies { // @Resource annotation (removed post Java 8) implementation 'jakarta.annotation:jakarta.annotation-api' - implementation 'org.thymeleaf:thymeleaf-spring5' + implementation 'org.thymeleaf:thymeleaf-spring6' // Testing testImplementation "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" diff --git a/tds/src/main/java/thredds/server/views/TdsExtensibleTemplateResolver.java b/tds/src/main/java/thredds/server/views/TdsExtensibleTemplateResolver.java index 51558539e0..6fe00cd9fd 100644 --- a/tds/src/main/java/thredds/server/views/TdsExtensibleTemplateResolver.java +++ b/tds/src/main/java/thredds/server/views/TdsExtensibleTemplateResolver.java @@ -4,7 +4,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.thymeleaf.IEngineConfiguration; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.templateresource.FileTemplateResource; import org.thymeleaf.templateresource.ITemplateResource; import org.thymeleaf.util.StringUtils; diff --git a/tds/src/main/webapp/WEB-INF/spring-servlet.xml b/tds/src/main/webapp/WEB-INF/spring-servlet.xml index 926530b003..6f7052f40a 100644 --- a/tds/src/main/webapp/WEB-INF/spring-servlet.xml +++ b/tds/src/main/webapp/WEB-INF/spring-servlet.xml @@ -31,7 +31,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -49,7 +49,7 @@ - + From e6860979820742e2cff1d75914d6604b348609e9 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Mon, 29 Jul 2024 14:58:17 -0600 Subject: [PATCH 11/25] The logDir option does not exist in gretty 4 --- gradle/any/gretty.gradle | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/gradle/any/gretty.gradle b/gradle/any/gretty.gradle index 2bd0de460c..7fe072a638 100644 --- a/gradle/any/gretty.gradle +++ b/gradle/any/gretty.gradle @@ -52,23 +52,6 @@ gretty { // We want to modify Gretty tasks but they won't be added to the project until after evaluation: // http://goo.gl/qlFXTD. So, our modifications must also occur after evaluation. afterEvaluate { - // Change the log directory of all tasks that start a server. - // Due to a bug, the normal instanceof operator won't work here. Nor will tasks.withType(). - tasks.matching { - GradleUtils.instanceOf(it, AppStartTask.name) - }.each { - // LauncherConfig is only meant to be retrieved during the execution phase, hence the doFirst{}. - // If we try to grab it during evaluation, we get: - // Error opening zip file or JAR manifest missing : - // build/tmp/expandedArchives/org.jacoco.agent-0.7.7.201606060606.jar_aj7uwwfluzmrbfb6clshgf6du/jacocoagent.jar - it.doFirst { - // tomcatBaseDir is the working directory for embedded tomcat. We want to write our logs there as well. - File tomcatBaseDir = it.launcherConfig.baseDir - - // Will be something like: "$projectDir/build/serverBaseDir_tomcat8/logs". - it.logDir = file("$tomcatBaseDir/logs").absolutePath - } - } // These enable HTTPS authentication, which is needed to access the TDS admin interface. httpsEnabled = true From 8185e22abbfd1b5a8d1b77cc808f735a8c341009 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Mon, 29 Jul 2024 16:13:31 -0600 Subject: [PATCH 12/25] Prevent log4j from pulling in newer h2database than edal-java uses --- tds-platform/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 90d9474f82..0330952d32 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -19,7 +19,10 @@ dependencies { api platform('net.openhft:chronicle-bom:2.25ea62') api enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.17.1") // remove log4j-jakarta-web and use log4j-jakarta-bom when that is released - api enforcedPlatform("org.apache.logging.log4j:log4j-jakarta-web:2.23.1") + api enforcedPlatform("org.apache.logging.log4j:log4j-jakarta-web:2.23.1") { + // Use version from edal-java for h2database + exclude group: 'com.h2database', module: 'h2' + } api enforcedPlatform("jakarta.platform:jakarta.jakartaee-bom:9.0.0") From 2cb28ea73b7d6e10d180b0225ad66f1786468a09 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Tue, 30 Jul 2024 15:51:43 -0600 Subject: [PATCH 13/25] Add missing runtime jstl dependency --- tds-platform/build.gradle | 2 ++ tds/build.gradle | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 0330952d32..12a5d66d5a 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -77,6 +77,8 @@ dependencies { // opendap api 'edu.ucar:opendap' api "jakarta.servlet:jakarta.servlet-api" + api "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:2.0.0" + api "org.glassfish.web:jakarta.servlet.jsp.jstl:2.0.0" runtime 'org.apache.taglibs:taglibs-standard-spec:1.2.5' runtime 'org.apache.taglibs:taglibs-standard-impl:1.2.5' diff --git a/tds/build.gradle b/tds/build.gradle index bd3f87b72e..cab7620cba 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -39,6 +39,8 @@ dependencies { // Server stuff providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.jakartaServletApi}" + runtimeOnly "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api" + runtimeOnly "org.glassfish.web:jakarta.servlet.jsp.jstl" runtimeOnly 'org.apache.taglibs:taglibs-standard-spec' runtimeOnly 'org.apache.taglibs:taglibs-standard-impl' From c8c1fc261769d3d9ceaff4cbb2c68fcaa640532b Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 31 Jul 2024 14:52:12 -0600 Subject: [PATCH 14/25] Fix deprecation warning in thymeleaf by wrapping fragment expression --- tds/src/main/webapp/WEB-INF/templates/catalog.html | 2 +- tds/src/main/webapp/WEB-INF/templates/gridFragments.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tds/src/main/webapp/WEB-INF/templates/catalog.html b/tds/src/main/webapp/WEB-INF/templates/catalog.html index 852042fc6e..677355e0d0 100644 --- a/tds/src/main/webapp/WEB-INF/templates/catalog.html +++ b/tds/src/main/webapp/WEB-INF/templates/catalog.html @@ -2,7 +2,7 @@ - + TDS Catalog diff --git a/tds/src/main/webapp/WEB-INF/templates/gridFragments.html b/tds/src/main/webapp/WEB-INF/templates/gridFragments.html index ea46f0c0c1..1c17b2c365 100644 --- a/tds/src/main/webapp/WEB-INF/templates/gridFragments.html +++ b/tds/src/main/webapp/WEB-INF/templates/gridFragments.html @@ -6,7 +6,7 @@ - + From 5612371c08015f66ff94acd799573cecf8ec22ca Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Fri, 2 Aug 2024 10:25:54 -0600 Subject: [PATCH 15/25] Force use of jakarta servlet api version 6.0.0 in tests for spring mocks to work --- gradle/any/shared-mvn-coords.gradle | 2 ++ tds/build.gradle | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/gradle/any/shared-mvn-coords.gradle b/gradle/any/shared-mvn-coords.gradle index e13ab83d25..55a1841ed7 100644 --- a/gradle/any/shared-mvn-coords.gradle +++ b/gradle/any/shared-mvn-coords.gradle @@ -27,6 +27,8 @@ ext { // gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven // coordinates for jakarta.servlet-api if the gradle plugin in applied. If we don't, we see errors like this: depVersion.jakartaServletApi = '5.0.0' + // Spring 6.x servlet mocks require servlet 6 though it can test 5 code + depVersion.testJakartaServletApi = '6.0.0' depVersion.hibernateValidator = '7.0.0.Final' // TODO: figure out way to keep this version in sync with netcdf-java version // It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't diff --git a/tds/build.gradle b/tds/build.gradle index cab7620cba..1242e6b613 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -124,6 +124,12 @@ configurations.testRuntimeOnly { exclude group: 'org.apache.logging.log4j' } +configurations.testRuntimeClasspath { + resolutionStrategy { + force "jakarta.servlet:jakarta.servlet-api:${depVersion.testJakartaServletApi}" + } +} + task copyWebappFilesForTests(type: Copy) { // Tests expect for certain webapp files to be accessible from the classpath (e.g. WEB-INF/applicationContext.xml). from 'src/main/webapp' From 8ec931554f39df1d5bf0330f6c18b2b14764d452 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Fri, 2 Aug 2024 10:37:01 -0600 Subject: [PATCH 16/25] Upgrade jakarta el api to version 4 (which corresponds to Jakarta EE 9) --- tds-platform/build.gradle | 2 +- tds/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 12a5d66d5a..bd05f5d876 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -97,7 +97,7 @@ dependencies { api "org.hibernate.validator:hibernate-validator-annotation-processor:${depVersion.hibernateValidator}" api 'jakarta.el:jakarta.el-api' api'org.apache.commons:commons-lang3:3.4' - runtime 'org.glassfish:javax.el:3.0.0' + runtime 'org.glassfish:jakarta.el:4.0.2' runtime "jaxen:jaxen:${depVersion.jaxen}" // waterml stuff diff --git a/tds/build.gradle b/tds/build.gradle index 1242e6b613..c1145704b7 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -87,7 +87,7 @@ dependencies { // JSR 303 with Hibernate Validator, which is dragging in jboss logging runtimeOnly 'org.hibernate.validator:hibernate-validator' - runtimeOnly 'org.glassfish:javax.el' + runtimeOnly 'org.glassfish:jakarta.el' annotationProcessor "org.hibernate.validator:hibernate-validator-annotation-processor:${depVersion.hibernateValidator}" // @Resource annotation (removed post Java 8) From 58c22cc7e69f26c358fbe00540f77b0892595ef6 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Fri, 2 Aug 2024 10:55:03 -0600 Subject: [PATCH 17/25] Add -parameters to java compiler options. This is needed by spring 6 to retain parameter names --- gradle/any/java-internal.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/any/java-internal.gradle b/gradle/any/java-internal.gradle index 1c8417783f..056d2f5dd0 100644 --- a/gradle/any/java-internal.gradle +++ b/gradle/any/java-internal.gradle @@ -9,6 +9,7 @@ java { // Will apply to "compileJava", "compileTestJava", "compileSourceSetJava", etc. tasks.withType(JavaCompile).all { options.encoding = 'UTF-8' + options.compilerArgs.add("-parameters") // show deprecation details //options.compilerArgs = ['-Xlint:deprecation'] From f11b1236de9363e02232bc34300023f7a45e4340 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 14 Aug 2024 11:42:28 -0600 Subject: [PATCH 18/25] Update web app schema from java ee to jarkarta ee --- tds/src/main/webapp/WEB-INF/web.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tds/src/main/webapp/WEB-INF/web.xml b/tds/src/main/webapp/WEB-INF/web.xml index 4e2efbe07b..72c3107fb3 100644 --- a/tds/src/main/webapp/WEB-INF/web.xml +++ b/tds/src/main/webapp/WEB-INF/web.xml @@ -1,8 +1,8 @@ - + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" + version="5.0"> THREDDS Data Server From 37b2076fa539994470a6eb27ebb1e3fddf9bc0f0 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 14 Aug 2024 14:24:10 -0600 Subject: [PATCH 19/25] Use ant request matchers for spring security filters --- .../webapp/WEB-INF/applicationContext.xml | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/tds/src/main/webapp/WEB-INF/applicationContext.xml b/tds/src/main/webapp/WEB-INF/applicationContext.xml index 886d28a747..2538a66717 100644 --- a/tds/src/main/webapp/WEB-INF/applicationContext.xml +++ b/tds/src/main/webapp/WEB-INF/applicationContext.xml @@ -30,29 +30,27 @@ - - - - - - - - - + + + + + + + From a466577599bbe05537f0f6a39fc3c46847298be6 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 14 Aug 2024 14:56:31 -0600 Subject: [PATCH 20/25] Ignore test that expects tomcat log directory to exist (this used to be configured through gretty) --- .../java/thredds/server/services/TestAdminDebug.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tds/src/integrationTests/java/thredds/server/services/TestAdminDebug.java b/tds/src/integrationTests/java/thredds/server/services/TestAdminDebug.java index 6376bbc0a8..faddc9b314 100644 --- a/tds/src/integrationTests/java/thredds/server/services/TestAdminDebug.java +++ b/tds/src/integrationTests/java/thredds/server/services/TestAdminDebug.java @@ -37,7 +37,8 @@ public static List getTestParameters() { List result = new ArrayList<>(10); result.add(new Object[] {"admin/debug?General/showTdsContext"}); result.add(new Object[] {"admin/dir/content/thredds/logs/"}); - result.add(new Object[] {"admin/dir/logs/"}); + // TODO serverBaseDir_tomcat10/logs does not exist as logDir can no longer be configured through gretty + // result.add(new Object[] {"admin/dir/logs/"}); result.add(new Object[] {"admin/dir/catalogs/"}); result.add(new Object[] {"admin/spring/showControllers"}); return result; From c710bda6cfffda09a6eabbb46977ad4593a553d7 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 15 Aug 2024 14:16:27 -0600 Subject: [PATCH 21/25] Remove unused gretty logging configs --- gradle/gretty/log4j2Config.xml | 19 ------------------- gradle/gretty/logback.xml | 14 -------------- 2 files changed, 33 deletions(-) delete mode 100644 gradle/gretty/log4j2Config.xml delete mode 100644 gradle/gretty/logback.xml diff --git a/gradle/gretty/log4j2Config.xml b/gradle/gretty/log4j2Config.xml deleted file mode 100644 index 6a26008fef..0000000000 --- a/gradle/gretty/log4j2Config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/gradle/gretty/logback.xml b/gradle/gretty/logback.xml deleted file mode 100644 index 791f303e3c..0000000000 --- a/gradle/gretty/logback.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - %highlight([%d{HH:mm:ss.SSS} %-5level %logger{36}]) %message%n - - - - - - - - \ No newline at end of file From 3ded6b49886d4b248517760201a9be62075afad3 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 15 Aug 2024 15:46:53 -0600 Subject: [PATCH 22/25] Use latest edal-java snapshot --- tds-platform/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index bd05f5d876..3272a98fe8 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -106,7 +106,7 @@ dependencies { api 'org.n52.sensorweb:52n-xml-om-v20' // edal-java (ncwms) - def edalVersion = '1.5.2.0' + def edalVersion = '1.5.2.1-SNAPSHOT' api "uk.ac.rdg.resc:edal-common:${edalVersion}" api "uk.ac.rdg.resc:edal-cdm:${edalVersion}" api "uk.ac.rdg.resc:edal-wms:${edalVersion}" From b2b2ebfb05a361a5875fa5653a8b0827a5d290e8 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 15 Aug 2024 16:49:08 -0600 Subject: [PATCH 23/25] Update documentation to refer to tomcat 10 instead of 8.5/9 --- docs/userguide/src/site/_config.yml | 2 +- .../getting_started/InstallJavaTomcat.md | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/userguide/src/site/_config.yml b/docs/userguide/src/site/_config.yml index 869bcc9e9f..7e438cc4d0 100644 --- a/docs/userguide/src/site/_config.yml +++ b/docs/userguide/src/site/_config.yml @@ -78,4 +78,4 @@ docset_name: userguide netcdf-java_docset_version: 5.6 # this will appear in various doc pages -tomcat_version: 9.0 +tomcat_version: 10.1 diff --git a/docs/userguide/src/site/pages/tds_tutorial/getting_started/InstallJavaTomcat.md b/docs/userguide/src/site/pages/tds_tutorial/getting_started/InstallJavaTomcat.md index 1135d27998..6eb6d8cf5f 100644 --- a/docs/userguide/src/site/pages/tds_tutorial/getting_started/InstallJavaTomcat.md +++ b/docs/userguide/src/site/pages/tds_tutorial/getting_started/InstallJavaTomcat.md @@ -15,7 +15,7 @@ Users of OS-provided packages via package management systems for Java and/or Tom ## System Requirements * OpenJDK Java 17 -* Apache Tomcat 8.x or 9.x +* Apache Tomcat 10.x While there are different distributors of Java and servlet containers, Unidata develops, uses and tests the THREDDS Data Server using _OpenJDK Java_ and the _Apache Tomcat_ servlet container. @@ -83,12 +83,12 @@ The following example shows Tomcat installation on a linux system. The installation is performed as the `root` user. {% include note.html content=" -For installation of Tomcat on Windows, see the [Tomcat Setup Guide](http://tomcat.apache.org/tomcat-8.5-doc/setup.html#Windows){:target='_blank'}. +For installation of Tomcat on Windows, see the [Tomcat Setup Guide](http://tomcat.apache.org/tomcat-10.1-doc/setup.html#Windows){:target='_blank'}. " %} -1. [Download](http://tomcat.apache.org/download-80.cgi){:target="_blank"} current version of the Tomcat 8.5 servlet container. +1. [Download](https://tomcat.apache.org/download-10.cgi){:target="_blank"} current version of the Tomcat servlet container. -2. Install Tomcat as per the Apache Tomcat [installation instructions](http://tomcat.apache.org/tomcat-8.5-doc/setup.html){:target="_blank"}. +2. Install Tomcat as per the Apache Tomcat [installation instructions](http://tomcat.apache.org/tomcat-10.1-doc/setup.html){:target="_blank"}. Copy the binary tar.gz file into the installation directory (`/usr/local` in this example): @@ -96,18 +96,18 @@ For installation of Tomcat on Windows, see the [Tomcat Setup Guide](http://tomca # pwd /usr/local - # cp /tmp/apache-tomcat-8.5.34.tar.gz . + # cp /tmp/apache-tomcat-xx.tar.gz . # ls -l total 196676 - -rw-r--r-- 1 root root 9625824 Oct 24 13:27 apache-tomcat-8.5.34.tar.gz + -rw-r--r-- 1 root root 9625824 Oct 24 13:27 apache-tomcat-xx.tar.gz drwxr-xr-x 7 root root 4096 Oct 6 07:58 jdk-xx ~~~ Unpack the archive file: ~~~bash - # tar xvfz apache-tomcat-8.5.34.tar.gz + # tar xvfz apache-tomcat-xx.tar.gz ~~~ This will create a Tomcat directory: @@ -115,18 +115,18 @@ For installation of Tomcat on Windows, see the [Tomcat Setup Guide](http://tomca ~~~bash # ls -l total 196680 - drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-8.5.34 - -rw-r--r-- 1 root root 9625824 Oct 24 13:27 apache-tomcat-8.5.34.tar.gz + drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-xx + -rw-r--r-- 1 root root 9625824 Oct 24 13:27 apache-tomcat-xx.tar.gz drwxr-xr-x 7 root root 4096 Oct 6 07:58 jdk-xx ~~~ Remove the remaining binary `tar.gz` file when the installation is complete. ~~~bash - # rm apache-tomcat-8.5.34.tar.gz + # rm apache-tomcat-xx.tar.gz # ls -l total 187282 - drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-8.5.34 + drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-xx drwxr-xr-x 7 root root 4096 Oct 6 07:58 jdk-xx ~~~ @@ -148,12 +148,12 @@ Windows users can consult the [Microsoft Documentation](https://docs.microsoft.c # pwd /usr/local - # ln -s apache-tomcat-8.5.34 tomcat + # ln -s apache-tomcat-xx tomcat # ln -s jdk-xx jdk # ls -l total 196684 - drwxr-xr-x 9 root root 4096 Oct 24 13:29 tomcat -> apache-tomcat-8.5.34 - drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-8.5.34 + drwxr-xr-x 9 root root 4096 Oct 24 13:29 tomcat -> apache-tomcat-xx + drwxr-xr-x 9 root root 4096 Oct 24 13:29 apache-tomcat-xx lrwxrwxrwx 1 root root 12 Oct 24 13:59 jdk -> jdk-xx drwxr-xr-x 7 root root 4096 Oct 6 07:58 jdk-xx ~~~ From 445f34ccbb77bbe3fa87e7d86dbfe3abb0ef2d30 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Mon, 19 Aug 2024 09:35:58 -0600 Subject: [PATCH 24/25] Let spring handle its own errors instead of returning 500 for them (e.g. NoResourceFoundException should return 404) --- tds/src/main/java/thredds/server/TdsErrorHandling.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tds/src/main/java/thredds/server/TdsErrorHandling.java b/tds/src/main/java/thredds/server/TdsErrorHandling.java index 44df863de7..e40cf2c9c9 100644 --- a/tds/src/main/java/thredds/server/TdsErrorHandling.java +++ b/tds/src/main/java/thredds/server/TdsErrorHandling.java @@ -11,6 +11,7 @@ import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; +import org.springframework.web.ErrorResponse; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; @@ -174,7 +175,8 @@ public ResponseEntity handle(Throwable ex) throws Throwable { // at the start of this post. // AnnotationUtils is a Spring Framework utility class. // see https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc - if (AnnotationUtils.findAnnotation(ex.getClass(), ResponseStatus.class) != null) + // or if it is a spring ErrorResponse let the spring handlers deal with it + if (AnnotationUtils.findAnnotation(ex.getClass(), ResponseStatus.class) != null || ex instanceof ErrorResponse) throw ex; logger.error("uncaught exception", ex); From d880eef09052093636e1ed7882b2ebdb367c00a7 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Tue, 20 Aug 2024 10:37:04 -0600 Subject: [PATCH 25/25] Use log4j jarkarta web but do not enforce --- tds-platform/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 3272a98fe8..246dcb1af7 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -19,7 +19,7 @@ dependencies { api platform('net.openhft:chronicle-bom:2.25ea62') api enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.17.1") // remove log4j-jakarta-web and use log4j-jakarta-bom when that is released - api enforcedPlatform("org.apache.logging.log4j:log4j-jakarta-web:2.23.1") { + api platform("org.apache.logging.log4j:log4j-jakarta-web:2.23.1") { // Use version from edal-java for h2database exclude group: 'com.h2database', module: 'h2' }