Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix:fix the problem in the findTargetClass method #3716

Merged
merged 4 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion changes/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
### bugfix:
- [[#3686](https://github.com/seata/seata/pull/3686)] 修复Apollo集群配置项错误及NPE错误
- [[#3702](https://github.com/seata/seata/pull/3702)] 修改注释
- [[#3716](https://github.com/seata/seata/pull/3716)] 修复findTargetClass方法的错误
- [[#3717](https://github.com/seata/seata/pull/3717)] 更正interval的拼写



### optimize:
Expand Down Expand Up @@ -55,8 +56,10 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [cmonkey](https://github.com/cmonkey)
- [selfishlover](https://github.com/selfishlover)
- [13414850431](https://github.com/13414850431)
- [ls9527](https://github.com/ls9527)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wangliang181230](https://github.com/wangliang181230)


同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

Expand Down
3 changes: 3 additions & 0 deletions changes/en-us/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
### bugfix:
- [[#3686](https://github.com/seata/seata/pull/3686)] fix NPE and wrong cluster name of Apollo
- [[#3702](https://github.com/seata/seata/pull/3702)] fix some comments
- [[#3716](https://github.com/seata/seata/pull/3716)] fix the problem in the findTargetClass method
- [[#3717](https://github.com/seata/seata/pull/3717)] fix typo of interval



### optimize:
- [[#3678](https://github.com/seata/seata/pull/3678)] supplement missing configuration and new version documents
- [[#3654](https://github.com/seata/seata/pull/3654)] fix typo,applicationContex -> applicationContext
Expand Down Expand Up @@ -56,6 +58,7 @@
- [cmonkey](https://github.com/cmonkey)
- [selfishlover](https://github.com/selfishlover)
- [13414850431](https://github.com/13414850431)
- [ls9527](https://github.com/ls9527)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wangliang181230](https://github.com/wangliang181230)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import io.seata.common.util.CollectionUtils;
import io.seata.rm.tcc.remoting.parser.DubboUtil;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.framework.AdvisedSupport;
import org.springframework.aop.support.AopUtils;
Expand All @@ -48,8 +49,12 @@ public static Class<?> findTargetClass(Object proxy) throws Exception {
return null;
}
if (AopUtils.isAopProxy(proxy) && proxy instanceof Advised) {
Object targetObject = ((Advised) proxy).getTargetSource().getTarget();
return findTargetClass(targetObject);
// #issue 3709
final TargetSource targetSource = ((Advised) proxy).getTargetSource();
if (!targetSource.isStatic()) {
return targetSource.getTargetClass();
}
return findTargetClass(targetSource.getTarget());
}
return proxy.getClass();
}
Expand Down