异常:org.springframework.beans.factory.BeanNotOfRequiredTypeException
2017-04-04 15:54
567 查看
org.springframework.beans.factory.BeanNotOfRequiredTypeException 使用spring的AOP切面动态代理时,报错
原因:动态代理时使用的是spring自己生成的代理类,而配置文件中使用的是接口
解决方法:在配置中加入 <aop:aspectj-autoproxy proxy-target-class="true"/>
proxy-target-class="true"的相关作用如下:
proxy-target-class属性值决定是基于接口的还是基于类的代理被创建。
如果proxy-target-class 属性值被设置为true,那么基于类的代理将起作用(这时需要cglib库)
如果proxy-target-class属值被设置为false或者这个属性被省略,那么标准的JDK 基于接口的代理将起作用
原因:动态代理时使用的是spring自己生成的代理类,而配置文件中使用的是接口
解决方法:在配置中加入 <aop:aspectj-autoproxy proxy-target-class="true"/>
proxy-target-class="true"的相关作用如下:
proxy-target-class属性值决定是基于接口的还是基于类的代理被创建。
如果proxy-target-class 属性值被设置为true,那么基于类的代理将起作用(这时需要cglib库)
如果proxy-target-class属值被设置为false或者这个属性被省略,那么标准的JDK 基于接口的代理将起作用
相关文章推荐
- 在使用Spring AOP 时,启动服务抛出异常: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 【异常篇-spring】org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 处理异常:org.springframework.beans.factory.BeanNotOfRequiredTypeException
- Aurora-hec4.0_scaninvoice_异常_04_org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException:
- org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named "" must be of type [org.apache.struts.action.Action
- 运用spring时出现org.springframework.beans.factory.BeanNotOfRequiredTypeException: 错误
- org.springframework.beans.factory.BeanNotOfRequiredTypeException
- Spring-org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException 错误,
- org.springframework.beans.factory.BeanNotOfRequiredTypeException must be of type
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'faceAction' must be of
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 代理及注入之org.springframework.beans.factory.BeanNotOfRequiredTypeException
- Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'dao' is exp
- "org.springframework.beans.factory.BeanNotOfRequiredTypeException……" 错误解决方案
- org.springframework.beans.factory.BeanNotOfRequiredTypeException的解决办法
- org.springframework.beans.factory.BeanNotOfRequiredTypeException:
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill