Spring 使用AOP导致IOC注入失败
来源:互联网 发布:mac地址烧录工具 编辑:程序博客网 时间:2024/05/16 01:03
前几天把权限系统重构了,服务层针对前后台分别提供相应的接口,但在配置注入的时候出现如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysCurrentSessionService' defined in ServletContext resource [/WEB-INF/servicecontext/sysUserContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy1 implementing com.centerm.service.rightmanage.ISysUserService,com.centerm.service.rightmanage.ISysUser4Dwr,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.centerm.service.rightmanage.Impl.SysUserService] for property 'sysUserService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy1 implementing com.centerm.service.rightmanage.ISysUserService,com.centerm.service.rightmanage.ISysUser4Dwr,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.centerm.service.rightmanage.Impl.SysUserService] for property 'sysUserService': no matching editors or conversion strategy found
上面的英文意思说无法将一个实现com.centerm.service.rightmanage.ISysUserService,com.centerm.service.rightmanage.ISysUser4Dwr,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised接口的代理注入给com.centerm.service.rightmanage.Impl.SysUserService
之所以会出现这个问题是:因为我配置了aop拦截了sysUserService对象,Spring依照sysUserService对象生成其接口的代理,当把这接口的代理塞给sysUserService对象出错了
简化下如下:
MyBean implements IBean
ProxyBean implements IBean
myBean=ProxyBean 当然会出错
- Spring 使用AOP导致IOC注入失败
- 【跪求解决方案】spring aop配置时ioc注入失败
- spring的IOC,DI依赖注入和AOP
- Spring IOC注入和AOP切面(1)
- spring中aop.ioc的使用
- spring的IOC、AOP的使用场景
- Spring AOP/DI/IOC 简述及使用
- Spring IOC使用(1) bean的注入
- spring IOC 使用list数组注入
- spring AOP注解拦截action导致无法注入
- Spring AOP切面类依赖注入失败问题解决
- 大小写不一致,导致Spring注入失败问题说明
- Spring之AOP IOC
- spring aop ioc 常识
- spring ioc 、 aop原理
- spring - ioc和aop
- spring - ioc和aop
- Spring AOP和IOC
- c++中预编译头文件问题
- vc 打印示例
- c# ref out 的使用
- T-SQL中存储过程输出参数的默认值有何用?
- linux-2.6.29.4和linux-2.6.30
- Spring 使用AOP导致IOC注入失败
- 实战 Groovy: Groovy:Java 程序员的 DSL
- 绿坝现漏洞政府天价难护航
- 错误 0xc0202049: 数据流任务: 无法在只读列“ID”中插入数据
- conio.h头文件
- 正则表达式学习参考
- stdlib.h头文件
- 项目开发之敏捷模型
- VC