Bean named 'XXX' is expected to be of type [XXX] but was actually of type [com.sun.proxy.$Proxy7
AOP原理
<aop:aspectj-autoproxy />声明自动为spring容器中那些配置@aspectJ切面的bean创建代理,织入切面。
<aop:aspectj-autoproxy />的proxy-target-class属性,默认为false,表示使用jdk动态代理织入增强。当配为<aop:aspectj-autoproxy poxy-target-class="true"/>时,表示使用CGLib动态代理技术织入增强。如果proxy-target-class设置为false,但是目标类没有声明接口,则spring将自动使用CGLib动态代理。
解决方法
把<aop:aspectj-autoproxy/> 修改成<aop:aspectj-autoproxy proxy-target-class="true"/>
Bean named 'XXX' is expected to be of type [XXX] but was actually of type [com.sun.proxy.$Proxy7的更多相关文章
- Spring错误之org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'bookService' is expected to be of type 'pw.fengya.tx.BookService' but was actually of type 'com.sun.proxy.$Proxy1
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cas ...
- Bean named '...' is expected to be of type [...] but was actually of type [com.sun.proxy.$Proxy7解决方法
报错 三月 07, 2017 8:09:52 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepare ...
- Springboot2.x 启动报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Proxy82'
Springboot 2.0.5 搭建一个新项目启动后报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Pr ...
- 解决BeanNotOfRequiredTypeException: Bean named 'XXX' must be of type XXX, but was actually of type XXX问题
Java新手,困扰了一下午. 发布时总是报这样一个错误. org.springframework.beans.factory.BeanCreationException: Error creating ...
- No bean named 'xxxxx' is defined异常,已解决,这个坑很难发现,你get了吗
出现No bean named 'xxxxx' is defined异常 没有定义名为xxx的bean 如果你的代码写的都对,根本问题只有一个地方出错了,那就是你的 basePackage=的包名路径 ...
- spring注入时报错::No qualifying bean of type 'xxx.xxMapper'
做一个小项目,因为有 baseService,所以偷懒就没有写单独的每个xxService接口,直接写的xxServiceImpl,结果在service实现类中注入Mapper的时候,用的 @Auto ...
- Spring:No bean named 'beanScope' is defined
初学Spring,“No bean named 'beanScope' is defined”这个问题困扰了我好几个小时,查资料无果后,重写好几遍代码后发现问题居然是配置文件不能放在包里...要放在s ...
- No bean named 'transactionManager' is defined
2016-10-20 23:27:17.771 INFO 7096 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped &quo ...
- 开发错误日志之No matching bean of type [xxx] found for dependency
No matching bean of type [org.springframework.data.mongodb.core.MongoTemplate] found for dependency ...
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSessionRepositoryFilter' is defined
spring-session 集成redis,web.xml配置filter时候出现 No bean named 'springSessionRepositoryFilter' is defined ...
随机推荐
- 自顶向下深入分析Netty(七)--ChannelPipeline和ChannelHandler总述
自顶向下深入分析Netty(七)--ChannelPipeline和ChannelHandler总述 自顶向下深入分析Netty(七)--ChannelPipeline源码实现 自顶向下深入分析Net ...
- convmv 解决GBK 迁移到 UTF-8 ,中文 文件名乱码
yum install convmv 命令: convmv -f GBK -t UTF-8 -r --nosmart --notest <目标目录> -f from -t to --nos ...
- 蓝牙BLE: ATT协议层中属性(Attribute)
ATT(Attribute Protocol)属性层是GATT和GAP的基础,它定义了BLE协议栈上层的数据结构和组织方式. 属性(Attribute)概念是ATT层的核心,ATT层定义了属性的内容, ...
- mybatis查询mysql的datetime类型数据时间差了14小时
场景: 数据库字段: mybatis使用 now() 生成时间. 结果: 使用mybatis查询mysql中的数据时,所有时间都比数据库时间多了14小时,考虑了一下,初步判定是系统时区的问题.因为my ...
- BigDecimal 基本使用 比较大小和加减乘除
//比较大小: int a = bigdemical.compareTo(bigdemical2) //a = -1,表示bigdemical小于bigdemical2: //a = 0,表示bigd ...
- 最新sublime3配C++11编译环境
sublime text 3. version 3.2.1 build 3207 Package control: install package : C++11 (v0.0.9; github.co ...
- python - logging.basicConfig format参数无效
有这么一段python代码 import threading import time import requests from decimal import Decimal, ROUND_DOWN i ...
- advanceInstaller安装文件的ICON
修改以下配置 点击icon图标位置可重新选择
- Linux——xargs命令学习
有时候我们会遇到需要将指定命令返回结果进行处理的情况 这种情况下,可能就需要写for循环之类的脚本进行处理了(目前我只能想到这种方法) 但是想起来还有一个xargs命令,组合这个命令就比较省事了. 场 ...
- centos7 中查看log_bin是否开启以及开启log_bin
1.查看是否开启的命名: 在mysql客户端执行:show variables like 'log_bin'; ON:代表开启 OFF:代表未开启 2. 开启log_bin 在配置文件vi ...