用ibatis做查询,遇到这样的错误:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.ccutsesms.mis.service.QueryThesisService.<clinit>(QueryThesisService.java:13)
at test.com.ccutsesms.mis.util.TestQueryThesis.testGetAll(TestQueryThesis.java:49)
at test.com.ccutsesms.mis.util.TestQueryThesis.main(TestQueryThesis.java:61)
Caused by: java.lang.RuntimeException: Could not initialize DaoConfig.
Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: Record.recordMap
Caused by: java.lang.ClassNotFoundException: Record.recordMap
Caused by: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: Record.recordMap
Caused by: java.lang.ClassNotFoundException: Record.recordMap
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: Record.recordMap
Caused by: java.lang.ClassNotFoundException: Record.recordMap
Caused by: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: Record.recordMap
Caused by: java.lang.ClassNotFoundException: Record.recordMap
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: Record.recordMap
Caused by: java.lang.ClassNotFoundException: Record.recordMap
......
查了好久,最后发现是配置文件写错了!
<select id="getAllQueryThesises" resultClass="Record.recordMap">
SELECT
id,
ptid,
queryItem,
queryNum,
queryTime
FROM ThesisQuery ORDER BY id
</select>
将其中的resultClass改为resultMap,错误就没有了!
分享到:
相关推荐
ibatis-2.3.4.726.jar,ibatis-2.3.0.677.jar,ibatis-2.3.3.720.jar下载,都已放入一个压缩包下。
主要介绍了Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法的相关资料,需要的朋友可以参考下
Caused By: org.apache.ibatis.builder.BuilderException: Could not find SQL statement to include with refid 'SAD02.SAD02_COL' at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler....
hibernate下载 : http://sourceforge.net/projects/hibernate/files/hibernate3/--3.XX版本 ...IBATS下载地址:...比如:ibatis-2.3.0.677.jar, spring 可在下载你需要的版本: http://www.springsource.org/download
ibatis的dtd约束,版本2,xml文件中标签提示,网址:http://ibatis.apache.org/dtd/sql-map-2.dtd
1.iBatis2学习笔记:基本原理和配置.doc 2.iBatis2学习笔记:与Spring2的整合.doc 3.iBatis2学习笔记:单表映射 .doc 4.iBatis2学习笔记:SqlMap的配置总结(18条).doc 5.iBatis2学习笔记:入参和返回值的问题.doc ...
Caused by: org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested ...
使用的ognl,正对是struts2 hibernate 等
spring-ibatis 整合 springmvc 配置: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc=...
NULL 博文链接:https://linyuliang.iteye.com/blog/1249564
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not ...
ibatis jar src ibatis 2 3 0 677
Caused By: org.apache.ibatis.builder.BuilderException: Could not find SQL statement to include with refid 'SAD02.SAD02_COL' at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler....
iBATIS In Action:什么是iBATIS(一) 2007-08-19 20:39 by Anders Cui, 13917 阅读, 49 评论, 收藏, 编辑 在上一章中我们详细讨论了iBATIS的哲学观,以及这个框架的来历。我们也说过,iBATIS是一个混合式的解决...
一个程序员的自省 iBATIS In Action:什么是iBATIS代码
IBatis.DataMapper.1.6.2 和 IBatis.DataMapper.1.9 开发包
NULL 博文链接:https://sziitjiang.iteye.com/blog/1013134
NULL 博文链接:https://ninnd.iteye.com/blog/1156138
ibatis-2.3.3.720.jar