Skip to content

Commit ffa7d7e

Browse files
Upgrade to Spring Boot 4, Spring Framework 7, and Tomcat 11
1 parent 89b3f82 commit ffa7d7e

4 files changed

Lines changed: 11 additions & 16 deletions

File tree

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ apacheDirectoryVersion=2.1.7
9898
apacheMinaVersion=2.2.4
9999

100100
# Usually matches the version specified as a Spring Boot dependency (see springBootVersion below)
101-
apacheTomcatVersion=10.1.50
101+
apacheTomcatVersion=11.0.15
102102

103103
# (mothership) -> json-path -> json-smart -> accessor-smart
104104
# (core) -> graalvm
@@ -274,7 +274,7 @@ rforgeVersion=0.6-8.1
274274
romeVersion=2.1.0
275275

276276
# Tomcat 10 implements 6.x
277-
servletApiVersion=6.0.0
277+
servletApiVersion=6.1.0
278278

279279
# this version is forced for compatibility with pipeline and tika
280280
slf4jLog4j12Version=2.0.17
@@ -285,9 +285,9 @@ slf4jLog4jApiVersion=2.0.17
285285
snappyJavaVersion=1.1.10.8
286286

287287
# Also, update apacheTomcatVersion above to match Spring Boot's Tomcat dependency version
288-
springBootVersion=3.5.8
288+
springBootVersion=4.0.1
289289
# This usually matches the Spring Framework version dictated by springBootVersion
290-
springVersion=6.2.15
290+
springVersion=7.0.2
291291

292292
sqliteJdbcVersion=3.51.1.0
293293

server/embedded/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ dependencies {
7171
strictly "${springVersion}"
7272
}
7373
}
74-
implementation('org.springframework:spring-jcl') {
75-
version {
76-
strictly "${springVersion}"
77-
}
78-
}
7974
implementation('org.springframework:spring-web') {
8075
version {
8176
strictly "${springVersion}"

server/embedded/src/org/labkey/embedded/LabKeyServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.springframework.boot.autoconfigure.SpringBootApplication;
88
import org.springframework.boot.context.ApplicationPidFileWriter;
99
import org.springframework.boot.context.properties.ConfigurationProperties;
10-
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
10+
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
1111
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
1212
import org.springframework.context.annotation.Bean;
1313
import org.springframework.context.annotation.Configuration;
@@ -193,7 +193,7 @@ public TomcatServletWebServerFactory servletContainerFactory()
193193
Connector httpConnector = new Connector();
194194
httpConnector.setScheme("http");
195195
httpConnector.setPort(contextProperties.getHttpPort());
196-
result.addAdditionalTomcatConnectors(httpConnector);
196+
result.addAdditionalConnectors(httpConnector);
197197
}
198198

199199
return result;

server/embedded/src/org/labkey/embedded/LabKeyTomcatServletWebServerFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import org.apache.logging.log4j.Logger;
1515
import org.apache.tomcat.util.descriptor.web.ContextResource;
1616
import org.labkey.bootstrap.ConfigException;
17-
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
18-
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
17+
import org.springframework.boot.tomcat.TomcatWebServer;
18+
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
1919
import org.springframework.boot.web.servlet.ServletContextInitializer;
2020

2121
import javax.sql.DataSource;
@@ -72,7 +72,7 @@ public LabKeyTomcatServletWebServerFactory(LabKeyServer server)
7272
protected void prepareContext(Host host, ServletContextInitializer[] initializers)
7373
{
7474
// Prevent the Spring Boot webapp from trying to deserialize the LabKey sessions
75-
getSession().setPersistent(false);
75+
getSettings().getSession().setPersistent(false);
7676

7777
// Don't use Spring Boot's error pages, as we want to render our own
7878
setErrorPages(Collections.emptySet());
@@ -121,7 +121,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat)
121121
setRegisterDefaultServlet(false);
122122

123123
// We want the LK webapp to serialize/deserialize sessions during restarts
124-
getSession().setPersistent(true);
124+
getSettings().getSession().setPersistent(true);
125125

126126
// Spring Boot's webapp is being deployed to the root. We have to deploy elsewhere in this initial
127127
// call, but can immediately swap it with the desired place
@@ -130,7 +130,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat)
130130
context.setPath(contextProperties.getContextPath());
131131

132132
// Propagate standard Spring Boot properties such as the session timeout
133-
configureContext(context, new ServletContextInitializer[0]);
133+
configureContext(context, Collections.emptyList());
134134

135135
LabKeyServer.CSPFilterProperties cspFilterProperties = _server.cspSource();
136136

0 commit comments

Comments
 (0)