项目是sprin3+ibatis
问题出现在我用spring对ibatis事物管理,我是用AOP来申明的。
service和dao都是通过实现接口完成的。
但是报如下错误:
[code="java"]org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/daoContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy4 implementing com.service.IUserService,org.springframework.orm.ibatis.SqlMapClientOperations,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.orm.ibatis.SqlMapClientTemplate' for property 'sqlMapClientTemplate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy4 implementing com.service.IUserService,org.springframework.orm.ibatis.SqlMapClientOperations,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.orm.ibatis.SqlMapClientTemplate] for property 'sqlMapClientTemplate': no matching editors or conversion strategy found[/code]
[code="java"]<!-- IBATIS的DAO的配置注入 -->
[/code]
[code="java"] <!-- 系统业务逻辑层的注入 -->
[/code]
在网上到解决方案, [color=red] [/color]。但是这个是强制aop用cglib来代理的。按理说,我的service和dao都实现了接口,应该是默认jdk动态代理,但为什么会报错呢?