Commit 016e3df57a8ad76aa79aa2454afa30b1413ca0b9
1 parent
8e43004c
fix(job):@EnableAsync 显式 proxyTargetClass=true
仅含 @Async 而无 CGLIB 触发器(如 @Transactional)的 bean(如 ImWebSocketServiceImpl) 被 JDK 动态代理后,getSelf()=SpringUtil.getBean(getClass()) 按实现类取 bean 必抛 NoSuchBeanDefinitionException,致 IM 模块全部写操作事务内通知发送回滚整体 500。 与 @EnableTransactionManagement(proxyTargetClass = true) 口径对齐根治。 验证:修复后 IM 域回归 7 例两轮全绿(jobs 1422-1425/1427-1431); 诊断实证 proxyClass=jdk.proxy2.$Proxy926 仅接口型。
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoAsyncAutoConfiguration.java
| ... | ... | @@ -13,7 +13,7 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor; |
| 13 | 13 | * 异步任务 Configuration |
| 14 | 14 | */ |
| 15 | 15 | @AutoConfiguration |
| 16 | -@EnableAsync | |
| 16 | +@EnableAsync(proxyTargetClass = true) // proxyTargetClass=true:与 @EnableTransactionManagement(proxyTargetClass = true) 保持一致 | |
| 17 | 17 | public class YudaoAsyncAutoConfiguration { |
| 18 | 18 | |
| 19 | 19 | @Bean | ... | ... |