use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching

简介: use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching

今天在做异步的时候,报了个错,错误信息如下:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-08-25 17:58:30.784 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter:40 -


APPLICATION FAILED TO START


Description:

The bean 'subscribeHandler' could not be injected because it is a JDK dynamic proxy

The bean is of type 'com.sun.proxy.$Proxy195' and implements:

me.chanjar.weixin.mp.api.WxMpMessageHandler
org.springframework.aop.SpringProxy
org.springframework.aop.framework.Advised
org.springframework.core.DecoratingProxy

Expected a bean of type 'org.jeecg.modules.wechat.handler.SubscribeHandler' which implements:

Action:

Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

2022-08-25 17:58:31.721 [Thread-7] WARN com.alibaba.nacos.common.http.HttpClientBeanHolder:108 - [HttpClientBeanHolder] Start destroying common HttpClient

解决方法

启动器不能只写个@EnableAsync就完事儿了。
还需要在后面加上:(proxyTargetClass = true)
完成写法应该是这样的:

@EnableAsync(proxyTargetClass = true)

在这里插入图片描述

目录
相关文章
|
Java 数据库 Spring
【异常】because it is a JDK dynamic proxy that implements
【异常】because it is a JDK dynamic proxy that implements
479 0
|
Linux 数据安全/隐私保护 Windows
更换(Pypi)pip源到国内镜像
pip国内的一些镜像 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.
247447 2
|
9月前
|
Swift
DeepSeek开源Janus-Pro多模态理解生成模型,魔搭社区推理、微调最佳实践
Janus-Pro是DeepSeek最新开源的多模态模型,是一种新颖的自回归框架,统一了多模态理解和生成。
847 19
DeepSeek开源Janus-Pro多模态理解生成模型,魔搭社区推理、微调最佳实践
|
8月前
|
人工智能 搜索推荐 物联网
线上共学 | Mac本地玩转大模型
本文介绍如何在Mac本地部署和使用大模型,包括基础运行、多模态扩展、交互优化、知识增强、定制进化等技术链路,并提供Ollama、Stable Diffusion、LM-Studio等工具的详细操作指南。
1647 8
|
12月前
|
Java
实现java执行kettle并传参数
实现java执行kettle并传参数
219 1
|
Java 数据库连接 mybatis
成功解决: Invalid bound statement (not found) 在已经使用mybatis的项目里引入mybatis-plus,结果不能共存的解决
这篇文章讨论了在已使用MyBatis的项目中引入MyBatis-Plus后出现的"Invalid bound statement (not found)"错误,并提供了解决方法,主要是通过修改yml配置文件来解决MyBatis和MyBatis-Plus共存时的冲突问题。
成功解决: Invalid bound statement (not found) 在已经使用mybatis的项目里引入mybatis-plus,结果不能共存的解决
|
前端开发 Java
后端BUG系列之:SpringBoot上传文件太大 报错 Maximum upload size exceeded
这篇文章讨论了SpringBoot应用中上传文件过大导致的错误"Maximum upload size exceeded",并提供了通过修改`application.properties`文件中的上传限制配置来解决这个问题的方法。
spring-boot报错循环注入报错:has been injected into other beans
spring-boot报错循环注入报错:has been injected into other beans
1678 3
|
机器学习/深度学习 自然语言处理 API
初识LangChain的快速入门指南
初识LangChain的快速入门指南
|
SQL Java 关系型数据库
实时计算 Flink版产品使用合集之 TaskManager 上的所有 Managed Memory 占用率达到了 100%,是什么导致的
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
236 0