在使用Spring AOP 时,启动服务抛出异常: org.springframework.beans.factory.BeanNotOfRequiredTypeException
2017-05-07 00:00
681 查看
编号 | 004 |
错误、问题类型 | Java Spring框架开发 |
描述 | 在使用Spring AOP 时,启动服务抛出异常: org.springframework.beans.factory.BeanNotOfRequiredTypeException |
解决方案 | 该问题往往因代码中默认使用了JDK的动态代理注入而引起的,由于JDK的动态代理不支持类注入,只支持接口注入。 解决方法有3种: 1、 修改代码,统一使用接口注入,不使用类注入; 2、 使用CGLib代理; 3、 在Spring的AOP配置中添加如下配置,使Spring代理目标类: <aop:config proxy-target-class="true"> |
是否解决 | 是 |
相关文章推荐
- 【异常篇-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 'faceAction' must be of
- org.springframework.beans.factory.BeanNotOfRequiredTypeException must be of type
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException:
- org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 运用spring时出现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: Bean named "" must be of type [org.apache.struts.action.Action
- org.springframework.beans.factory.BeanNotOfRequiredTypeException 错误,
- Spring-org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 代理及注入之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