读书人

ibatis resultClass 挑动的悲剧

发布时间: 2013-09-11 17:27:29 作者: rapoo

ibatis resultClass 引发的悲剧

关于 com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance.?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [config/baseContext.xml]

的一种解释

?

?

今天折腾了三个小时 第一次集成Spring和Ibatis 项目需要,照着书上的配置配置完成以后,启动tomcat服务器始终出现org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [config/baseContext.xml]

这个异常,苦恼万分,在网上也没有找到合适的答案。无奈之下,单独建了一个工程,检查ibatis的配置是否正确,就出现了

com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance.

这个异常,之后又提到关于resultClass not found的问题

所以检查了一下ResultClass的属性

?之后 问题解决了。

?运行成功!

?

切记,即使在同一目录或者说在同一包下,也要使用resultClass也要使用全限定名,parameterClass应该也是这个道理,如果不是ibatis内置的类型,应该也要使用全限定名,当然如果是内置类型,可以使用ibatis定义的别名。当然也可以自己定义别名,通过<typeAlias>标签


我的异常网推荐解决方案:org.springframework.beans.factory.BeanCreationException:,http://www.myexception.cn/j2ee/10759.html

读书人网 >软件架构设计

热点推荐