From ab4574e392de35d650f11eabaa56be002a5cf302 Mon Sep 17 00:00:00 2001 From: xiaoxiangyeyu0 <525718210@qq.com> Date: Wed, 22 Jan 2025 15:56:06 +0800 Subject: [PATCH] bugfix: GlobalTransactionScanner.afterPropertiesSet need do scanner check (#7124) --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + .../seata/spring/annotation/GlobalTransactionScanner.java | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 5aa6c195674..fb389bf5cfd 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -15,6 +15,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#7116](https://github.com/apache/incubator-seata/pull/7116)] fix prefix: seata.server.raft.ssl should not be null - [[#7112](https://github.com/apache/incubator-seata/pull/7112)] bugfix: remove the condition that IPv6 must start with fe80 - [[#7107](https://github.com/apache/incubator-seata/pull/7107)] fix the issue of failing to parse annotations in TCC mode when the business object is a proxy object. +- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] bugfix: GlobalTransactionScanner.afterPropertiesSet need do scanner check ### optimize: diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 315feafa6d5..b2b1f20c95d 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -15,6 +15,7 @@ - [[#7116](https://github.com/apache/incubator-seata/pull/7116)] 修复 seata.server.raft.ssl 前缀不存在的问题 - [[#7112](https://github.com/apache/incubator-seata/pull/7112)] 校验是否IPv6网络ip取消必须以fe80开始的条件 - [[#7107](https://github.com/apache/incubator-seata/pull/7107)] 修复tcc模式下,当业务对象为代理对象时,解析注解失败问题。 +- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] GlobalTransactionScanner.afterPropertiesSet方法需要做扫描检查 ### optimize: diff --git a/spring/src/main/java/org/apache/seata/spring/annotation/GlobalTransactionScanner.java b/spring/src/main/java/org/apache/seata/spring/annotation/GlobalTransactionScanner.java index 2170e59958f..c4713627831 100644 --- a/spring/src/main/java/org/apache/seata/spring/annotation/GlobalTransactionScanner.java +++ b/spring/src/main/java/org/apache/seata/spring/annotation/GlobalTransactionScanner.java @@ -341,6 +341,10 @@ private boolean doCheckers(Object bean, String beanName) { return false; } + return doScannerCheckers(bean, beanName); + } + + private boolean doScannerCheckers(Object bean, String beanName) { if (!SCANNER_CHECKER_SET.isEmpty()) { for (ScannerChecker checker : SCANNER_CHECKER_SET) { try { @@ -354,7 +358,6 @@ private boolean doCheckers(Object bean, String beanName) { } } } - return true; } @@ -512,6 +515,9 @@ private void findBusinessBeanNamesNeededEnhancement() { if (IGNORE_ENHANCE_CHECK_SET.contains(beanDefinition.getBeanClassName())) { continue; } + if (!doScannerCheckers(null, beanDefinition.getBeanClassName())) { + continue; + } try { // get the class by bean definition class name Class beanClass = Class.forName(beanDefinition.getBeanClassName());