This is an automated email from the ASF dual-hosted git repository.
xingfudeshi pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git
The following commit(s) were added to refs/heads/2.x by this push:
new 1c95bdef0b bugfix: consoleApiService that could not be found (#7960)
1c95bdef0b is described below
commit 1c95bdef0ba7c9537cd317df9e24bf1b08b9fa6d
Author: funkye <[email protected]>
AuthorDate: Mon Jan 26 09:46:02 2026 +0800
bugfix: consoleApiService that could not be found (#7960)
---
changes/en-us/2.6.0.md | 5 ++++-
changes/en-us/2.x.md | 1 +
changes/zh-cn/2.6.0.md | 5 ++++-
changes/zh-cn/2.x.md | 2 +-
.../mcp/service/impl/ConsoleRemoteServiceImpl.java | 24 +++++++++++-----------
.../service/ConsoleLocalServiceImpl.java | 12 +++++------
6 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/changes/en-us/2.6.0.md b/changes/en-us/2.6.0.md
index f10c809439..4a919af909 100644
--- a/changes/en-us/2.6.0.md
+++ b/changes/en-us/2.6.0.md
@@ -74,6 +74,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7891](https://github.com/apache/incubator-seata/pull/7891)] raft
split-brain causes incorrect cluster information
- [[#7908](https://github.com/apache/incubator-seata/pull/7908)] handle
timestamp with time zone in postgresql primary key
- [[#7938](https://github.com/apache/incubator-seata/pull/7938)] ensure the
Jakarta-related package paths are correct.
+- [[#7959](https://github.com/apache/incubator-seata/pull/7959)] fix
consoleApiService bean that could not be found
### optimize:
@@ -125,6 +126,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7913](https://github.com/apache/incubator-seata/pull/7913)] remove
@author info
- [[#7931](https://github.com/apache/incubator-seata/pull/7931)] pin the
Spring version for namingserver and console
- [[#7942](https://github.com/apache/incubator-seata/pull/7942)] update
jib-maven-plugin version and increase parallel test execution limits
+- [[#7935](https://github.com/apache/incubator-seata/pull/7935)] add OkHttp
and MockWebServer dependencies to resolve version conflicts
### security:
@@ -241,6 +243,7 @@ Thanks to these contributors for their code commits. Please
report an unintended
- [aias00](https://github.com/aias00)
- [NiMv1](https://github.com/NiMv1)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
+- [neronsoda](https://github.com/neronsoda)
-Also, we receive many valuable issues, questions and advices from our
community. Thanks for you all.
\ No newline at end of file
+Also, we receive many valuable issues, questions and advices from our
community. Thanks for you all.
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 51afff4541..39c893599d 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -28,6 +28,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7929](https://github.com/apache/incubator-seata/pull/7929)] fix
KingbaseUndoLogManager INSERT_UNDO_LOG_SQL error
- [[#7940](https://github.com/apache/incubator-seata/pull/7940)] ensure the
Jakarta-related package paths are correct
+- [[#7960](https://github.com/apache/incubator-seata/pull/7960)] fix
consoleApiService bean that could not be found
### optimize:
diff --git a/changes/zh-cn/2.6.0.md b/changes/zh-cn/2.6.0.md
index 1ab8854be5..1935426983 100644
--- a/changes/zh-cn/2.6.0.md
+++ b/changes/zh-cn/2.6.0.md
@@ -74,6 +74,7 @@
- [[#7891](https://github.com/apache/incubator-seata/pull/7891)]
修复raft重选举与心跳并发时可能导致namingserver侧的元数据存在多个leader
- [[#7908](https://github.com/apache/incubator-seata/pull/7908)] 在 PostgreSQL
主键中处理带时区的时间戳
- [[#7938](https://github.com/apache/incubator-seata/pull/7938)]
保证Jakarta相关包路径正确
+- [[#7959](https://github.com/apache/incubator-seata/pull/7959)]
修复consoleApiService bean未加载的问题
### optimize:
@@ -124,6 +125,7 @@
- [[#7913](https://github.com/apache/incubator-seata/pull/7913)] 移除 @author 信息
- [[#7931](https://github.com/apache/incubator-seata/pull/7931)]
固定namingserver和console的spring版本
- [[#7942](https://github.com/apache/incubator-seata/pull/7942)]
升级jib-maven-plugin版本和提高ci并行度
+- [[#7935](https://github.com/apache/incubator-seata/pull/7935)] 添加 OkHttp 和
MockWebServer 依赖来解决版本冲突
### security:
@@ -239,6 +241,7 @@
- [diguage](https://github.com/diguage)
- [aias00](https://github.com/aias00)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
+- [neronsoda](https://github.com/neronsoda)
-同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
\ No newline at end of file
+同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 413f4723be..cf9dc17c66 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -28,7 +28,7 @@
- [[#7929](https://github.com/apache/incubator-seata/pull/7929)] 修复
KingbaseUndoLogManager INSERT_UNDO_LOG_SQL 错误
- [[#7940](https://github.com/apache/incubator-seata/pull/7940)]
保证Jakarta相关包路径正确
-
+- [[#7960](https://github.com/apache/incubator-seata/pull/7960)]
修复consoleApiService bean未加载的问题
### optimize:
diff --git
a/console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java
b/console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java
index 0047f9b81d..4dfb152b1c 100644
---
a/console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java
+++
b/console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java
@@ -17,7 +17,6 @@
package org.apache.seata.mcp.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.seata.common.NamingServerLocalMarker;
import org.apache.seata.common.exception.AuthenticationFailedException;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.console.config.WebSecurityConfig;
@@ -44,10 +43,12 @@ import java.util.Map;
import static org.apache.seata.mcp.core.utils.UrlUtils.buildUrl;
import static org.apache.seata.mcp.core.utils.UrlUtils.objectToQueryParamMap;
-@ConditionalOnMissingBean(NamingServerLocalMarker.class)
+@ConditionalOnMissingBean(name = "consoleLocalServiceImpl")
@Service
public class ConsoleRemoteServiceImpl implements ConsoleApiService {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ConsoleRemoteServiceImpl.class);
+
private final JwtTokenUtils jwtTokenUtils;
private final RestTemplate restTemplate;
@@ -65,10 +66,9 @@ public class ConsoleRemoteServiceImpl implements
ConsoleApiService {
this.restTemplate = restTemplate;
this.objectMapper = objectMapper;
this.namingServerProperties = namingServerProperties;
+ LOGGER.info("ConsoleRemoteServiceImpl initialized.");
}
- private final Logger logger =
LoggerFactory.getLogger(ConsoleRemoteServiceImpl.class);
-
public String getToken() {
Authentication auth =
SecurityContextHolder.getContext().getAuthentication();
if (auth == null || !auth.isAuthenticated()) {
@@ -111,13 +111,13 @@ public class ConsoleRemoteServiceImpl implements
ConsoleApiService {
String errorMsg = String.format(
"MCP GET request failed with status: %s, response: %s",
response.getStatusCode(), response.getBody());
- logger.warn(errorMsg);
+ LOGGER.warn(errorMsg);
throw new ServiceCallException(errorMsg,
response.getStatusCode());
}
return responseBody;
} catch (RestClientException e) {
String errorMsg = "MCP GET Call NameSpace Failed.";
- logger.error(errorMsg, e);
+ LOGGER.error(errorMsg, e);
throw new ServiceCallException(errorMsg);
}
}
@@ -151,13 +151,13 @@ public class ConsoleRemoteServiceImpl implements
ConsoleApiService {
String errorMsg = String.format(
"MCP GET request failed with status: %s, response: %s",
response.getStatusCode(), response.getBody());
- logger.warn(errorMsg);
+ LOGGER.warn(errorMsg);
throw new ServiceCallException(errorMsg,
response.getStatusCode());
}
return responseBody;
} catch (RestClientException e) {
String errorMsg = "MCP GET Call TC Failed.";
- logger.error(errorMsg, e);
+ LOGGER.error(errorMsg, e);
throw new ServiceCallException(errorMsg);
}
}
@@ -191,13 +191,13 @@ public class ConsoleRemoteServiceImpl implements
ConsoleApiService {
String errorMsg = String.format(
"MCP DELETE request returned non-success status: %s,
response: %s",
response.getStatusCode(), response.getBody());
- logger.warn(errorMsg);
+ LOGGER.warn(errorMsg);
throw new ServiceCallException(errorMsg,
response.getStatusCode());
}
return responseBody;
} catch (RestClientException e) {
String errorMsg = "MCP DELETE Call TC Failed.";
- logger.error(errorMsg, e);
+ LOGGER.error(errorMsg, e);
throw new ServiceCallException(errorMsg);
}
}
@@ -231,13 +231,13 @@ public class ConsoleRemoteServiceImpl implements
ConsoleApiService {
String errorMsg = String.format(
"MCP PUT request returned non-success status: %s,
response: %s",
response.getStatusCode(), response.getBody());
- logger.warn(errorMsg);
+ LOGGER.warn(errorMsg);
throw new ServiceCallException(errorMsg,
response.getStatusCode());
}
return responseBody;
} catch (RestClientException e) {
String errorMsg = "MCP PUT Call TC Failed.";
- logger.error(errorMsg, e);
+ LOGGER.error(errorMsg, e);
throw new ServiceCallException(errorMsg);
}
}
diff --git
a/namingserver/src/main/java/org/apache/seata/namingserver/service/ConsoleLocalServiceImpl.java
b/namingserver/src/main/java/org/apache/seata/namingserver/service/ConsoleLocalServiceImpl.java
index 808f46552d..782e2c3019 100644
---
a/namingserver/src/main/java/org/apache/seata/namingserver/service/ConsoleLocalServiceImpl.java
+++
b/namingserver/src/main/java/org/apache/seata/namingserver/service/ConsoleLocalServiceImpl.java
@@ -26,7 +26,6 @@ import org.apache.seata.common.util.StringUtils;
import org.apache.seata.mcp.core.props.NameSpaceDetail;
import org.apache.seata.mcp.exception.ServiceCallException;
import org.apache.seata.mcp.service.ConsoleApiService;
-import org.apache.seata.mcp.service.impl.ConsoleRemoteServiceImpl;
import org.apache.seata.namingserver.manager.NamingManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,12 +47,12 @@ import static
org.apache.seata.common.Constants.RAFT_GROUP_HEADER;
import static org.apache.seata.mcp.core.utils.UrlUtils.buildUrl;
import static org.apache.seata.mcp.core.utils.UrlUtils.objectToQueryParamMap;
-@ConditionalOnBean(ConsoleRemoteServiceImpl.class)
+@ConditionalOnBean(NamingServerLocalMarkerImpl.class)
@Primary
@Service
public class ConsoleLocalServiceImpl implements ConsoleApiService {
- private final Logger logger = LoggerFactory.getLogger(this.getClass());
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ConsoleLocalServiceImpl.class);
private final NamingManager namingManager;
@@ -65,6 +64,7 @@ public class ConsoleLocalServiceImpl implements
ConsoleApiService {
this.namingManager = namingManager;
this.restTemplate = restTemplate;
this.objectMapper = objectMapper;
+ LOGGER.info("ConsoleLocalServiceImpl initialized.");
}
public String getResult(
@@ -109,13 +109,13 @@ public class ConsoleLocalServiceImpl implements
ConsoleApiService {
String errorMsg = String.format(
"MCP request failed with status: %s,
response: %s",
response.getStatusCode(),
response.getBody());
- logger.warn(errorMsg);
+ LOGGER.warn(errorMsg);
throw new ServiceCallException(errorMsg,
response.getStatusCode());
}
return responseBody;
} catch (RestClientException e) {
String errorMsg = "MCP Call TC Failed.";
- logger.error(errorMsg, e);
+ LOGGER.error(errorMsg, e);
throw new ServiceCallException(errorMsg);
}
}
@@ -161,7 +161,7 @@ public class ConsoleLocalServiceImpl implements
ConsoleApiService {
try {
namespace =
objectMapper.writeValueAsString(namingManager.namespace());
} catch (JsonProcessingException e) {
- logger.error("Get NameSpace failed: {}", e.getMessage());
+ LOGGER.error("Get NameSpace failed: {}", e.getMessage());
return "Failed to get namespace";
}
return namespace;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]