diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index ea951fedffc..e8ffacf603b 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -30,6 +30,7 @@ Add changes here for all PR submitted to the 2.x branch.
### optimize:
+- [[#8137](https://github.com/apache/incubator-seata/pull/8137)] server modules: spring-boot upgrade to 4.0.6
### security:
@@ -49,6 +50,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [slievrly](https://github.com/slievrly)
+- [xuxiaowei-com-cn](https://github.com/xuxiaowei-com-cn)
- [Seol-JY](https://github.com/Seol-JY)
- [lhozy](https://github.com/lhozy)
- [Zhengcy05](https://github.com/Zhengcy05)
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index c7754065724..77a68bc3fae 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -29,6 +29,7 @@
### optimize:
+- [[#8137](https://github.com/apache/incubator-seata/pull/8137)] server 模块: spring-boot 升级到 4.0.6
### security:
@@ -48,6 +49,7 @@
- [slievrly](https://github.com/slievrly)
+- [xuxiaowei-com-cn](https://github.com/xuxiaowei-com-cn)
- [Seol-JY](https://github.com/Seol-JY)
- [lhozy](https://github.com/lhozy)
- [Zhengcy05](https://github.com/Zhengcy05)
diff --git a/extensions/apm/pom.xml b/extensions/apm/pom.xml
index 8778b913ad6..94b5a2a230c 100644
--- a/extensions/apm/pom.xml
+++ b/extensions/apm/pom.xml
@@ -33,6 +33,18 @@
APM extensions for Seata built with Maven
- apm-seata-skywalking-plugin
+
-
\ No newline at end of file
+
+
+
+ JDK17Plus
+
+ [17,)
+
+
+ apm-seata-skywalking-plugin
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 05129717f49..47dfb4bc7d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,10 +57,10 @@
compressor
saga
sqlparser
- server
+
integration-tx-api
- test-suite/test-new-version
+
test-suite/test-old-version
test-suite/seata-benchmark-cli
json-common
@@ -129,6 +129,17 @@
+
+
+ JDK17Plus
+
+ [17,)
+
+
+ server
+ test-suite/test-new-version
+
+
JDK21Plus
@@ -372,7 +383,7 @@
distribution
- test-suite/test-new-version
+
test-suite/test-old-version
diff --git a/server/pom.xml b/server/pom.xml
index 9de1f407868..b7cd48a58cb 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -32,9 +32,10 @@
server for Seata built with Maven
- 2.7.18
- 5.3.39
+ 4.0.6
+ 7.0.7
2.0
+ 6.0.3
@@ -97,6 +98,10 @@
+
+ org.springframework.boot
+ spring-boot-web-server
+
org.springframework.boot
spring-boot-starter
diff --git a/server/src/main/java/org/apache/seata/server/Server.java b/server/src/main/java/org/apache/seata/server/Server.java
index 9c2a579495a..279ec87f5dc 100644
--- a/server/src/main/java/org/apache/seata/server/Server.java
+++ b/server/src/main/java/org/apache/seata/server/Server.java
@@ -16,6 +16,7 @@
*/
package org.apache.seata.server;
+import jakarta.annotation.Resource;
import org.apache.seata.common.XID;
import org.apache.seata.common.holder.ObjectHolder;
import org.apache.seata.common.thread.ThreadPoolExecutorFactory;
@@ -35,7 +36,6 @@
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
import java.util.Optional;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
diff --git a/server/src/main/java/org/apache/seata/server/ServerRunner.java b/server/src/main/java/org/apache/seata/server/ServerRunner.java
index 94545399a56..a363a726e78 100644
--- a/server/src/main/java/org/apache/seata/server/ServerRunner.java
+++ b/server/src/main/java/org/apache/seata/server/ServerRunner.java
@@ -16,19 +16,19 @@
*/
package org.apache.seata.server;
+import jakarta.annotation.Resource;
import org.apache.seata.core.rpc.Disposable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
diff --git a/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java b/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
index 9d1ac984ab7..1ad8ae0e833 100644
--- a/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
+++ b/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
@@ -31,6 +31,7 @@
import io.netty.handler.codec.http2.DefaultHttp2Headers;
import io.netty.handler.codec.http2.DefaultHttp2HeadersFrame;
import io.netty.handler.codec.http2.Http2Headers;
+import jakarta.annotation.PostConstruct;
import org.apache.seata.common.ConfigurationKeys;
import org.apache.seata.common.Constants;
import org.apache.seata.common.metadata.MetadataResponse;
@@ -51,7 +52,6 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashSet;
diff --git a/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java b/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
index 0f783a1b1bd..a9825707937 100644
--- a/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
+++ b/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
@@ -16,14 +16,13 @@
*/
package org.apache.seata.server.cluster.raft.context;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import org.apache.seata.common.ConfigurationKeys;
import org.apache.seata.config.ConfigurationFactory;
import org.apache.seata.core.context.ContextCore;
import org.apache.seata.core.context.ContextCoreLoader;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import static org.apache.seata.common.DefaultValues.DEFAULT_SEATA_GROUP;
/**
diff --git a/server/src/main/java/org/apache/seata/server/config/ServerConfig.java b/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
index 067666e1d81..9cc7e309d7e 100644
--- a/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
+++ b/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
@@ -16,7 +16,7 @@
*/
package org.apache.seata.server.config;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java b/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
index 5b82b605a13..1510551dd19 100644
--- a/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
+++ b/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
@@ -16,6 +16,7 @@
*/
package org.apache.seata.server.console.controller;
+import jakarta.annotation.Resource;
import org.apache.seata.common.result.SingleResult;
import org.apache.seata.server.console.service.BranchSessionService;
import org.slf4j.Logger;
@@ -25,8 +26,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
-
/**
* Branch Session Controller
*/
diff --git a/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java b/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
index fb7e3054f0c..ec37b3b2104 100644
--- a/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
+++ b/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
@@ -16,6 +16,7 @@
*/
package org.apache.seata.server.console.controller;
+import jakarta.annotation.Resource;
import org.apache.seata.common.result.PageResult;
import org.apache.seata.common.result.SingleResult;
import org.apache.seata.server.console.entity.param.GlobalLockParam;
@@ -29,8 +30,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
-
/**
* Global Lock Controller
*/
diff --git a/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java b/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
index a7703bc4100..48c5531c47b 100644
--- a/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
+++ b/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
@@ -16,6 +16,7 @@
*/
package org.apache.seata.server.console.controller;
+import jakarta.annotation.Resource;
import org.apache.seata.common.result.PageResult;
import org.apache.seata.common.result.SingleResult;
import org.apache.seata.server.console.entity.param.GlobalSessionParam;
@@ -30,8 +31,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
-
/**
* Global Session Controller
*/
diff --git a/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java b/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
index 16e772e7d14..1acaf087917 100644
--- a/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
+++ b/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
@@ -16,6 +16,7 @@
*/
package org.apache.seata.server.console.impl.db;
+import jakarta.annotation.Resource;
import org.apache.seata.common.ConfigurationKeys;
import org.apache.seata.common.exception.StoreException;
import org.apache.seata.common.loader.EnhancedServiceLoader;
@@ -36,7 +37,6 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
diff --git a/server/src/main/java/org/apache/seata/server/controller/ClusterController.java b/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
index b3f124bebc3..ef875f0eca6 100644
--- a/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
+++ b/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
@@ -18,6 +18,7 @@
import com.alipay.sofa.jraft.RouteTable;
import com.alipay.sofa.jraft.conf.Configuration;
+import jakarta.annotation.Resource;
import org.apache.seata.common.metadata.MetadataResponse;
import org.apache.seata.common.result.Result;
import org.apache.seata.common.rpc.http.HttpContext;
@@ -31,7 +32,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
import java.util.Map;
@RestController
diff --git a/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java b/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
index fd739519013..48dc7ef50c0 100644
--- a/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
+++ b/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
@@ -16,6 +16,9 @@
*/
package org.apache.seata.server.instance;
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
+import jakarta.annotation.Resource;
import org.apache.seata.common.metadata.Instance;
import org.apache.seata.common.thread.ThreadPoolExecutorFactory;
import org.apache.seata.core.protocol.Version;
@@ -25,12 +28,9 @@
import org.apache.seata.spring.boot.autoconfigure.properties.registry.RegistryProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.context.ApplicationContext;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Optional;
import java.util.concurrent.ScheduledExecutorService;
diff --git a/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java b/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
index 230933baa4d..a231e648306 100644
--- a/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
+++ b/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
@@ -17,6 +17,7 @@
package org.apache.seata.server.instance;
import com.alipay.sofa.jraft.entity.PeerId;
+import jakarta.annotation.Resource;
import org.apache.seata.common.XID;
import org.apache.seata.common.holder.ObjectHolder;
import org.apache.seata.common.metadata.ClusterRole;
@@ -36,8 +37,6 @@
import org.springframework.core.env.PropertySource;
import org.springframework.scheduling.annotation.Async;
-import javax.annotation.Resource;
-
import static org.apache.seata.common.ConfigurationKeys.META_PREFIX;
import static org.apache.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;
diff --git a/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java b/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
index 583f30275e6..e9ce9a004ef 100644
--- a/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
+++ b/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
@@ -26,10 +26,10 @@
import org.slf4j.LoggerFactory;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
-import redis.clients.jedis.JedisPoolAbstract;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.Protocol;
+import redis.clients.jedis.util.Pool;
import java.util.Arrays;
import java.util.HashSet;
@@ -47,7 +47,7 @@ public class JedisPooledFactory {
*/
protected static final Logger LOGGER = LoggerFactory.getLogger(JedisPooledFactory.class);
- private static volatile JedisPoolAbstract jedisPool = null;
+ private static volatile Pool jedisPool = null;
private static final String HOST = "127.0.0.1";
@@ -63,11 +63,11 @@ public class JedisPooledFactory {
*
* @return redisPool
*/
- public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisPools) {
+ public static Pool getJedisPoolInstance(Pool... jedisPools) {
if (jedisPool == null) {
synchronized (JedisPooledFactory.class) {
if (jedisPool == null) {
- JedisPoolAbstract tempJedisPool = null;
+ Pool tempJedisPool = null;
if (jedisPools != null && jedisPools.length > 0) {
tempJedisPool = jedisPools[0];
} else {
diff --git a/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java b/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
index f5d14070943..c27ebc1dae3 100644
--- a/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
+++ b/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
@@ -54,7 +54,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
-import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -500,7 +499,7 @@ public List readSortByTimeoutBeginSessions(boolean withBranchSess
// queryCount
final long queryCount = Math.min(logQueryLimit, countGlobalSessions);
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
- Set values = jedis.zrangeByScore(
+ List values = jedis.zrangeByScore(
REDIS_SEATA_BEGIN_TRANSACTIONS_KEY, 0, System.currentTimeMillis(), 0, (int) queryCount);
List