ibatis错误

盯着看了半天,最后发现xml中少了一段说明话,为什么手贱自己写xml呢

错误信息:

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath ‘/sqlMapConfig/sqlMap‘. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; 文档根元素 "sqlMap" 必须匹配 DOCTYPE 根 "null"。
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:89)
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)
at com.java1234.control.IuserDao.<clinit>(IuserDao.java:18)
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath ‘/sqlMapConfig/sqlMap‘. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; 文档根元素 "sqlMap" 必须匹配 DOCTYPE 根 "null"。
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86)
... 2 more
Caused by: java.lang.RuntimeException: Error parsing XPath ‘/sqlMapConfig/sqlMap‘. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; 文档根元素 "sqlMap" 必须匹配 DOCTYPE 根 "null"。
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
... 3 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; 文档根元素 "sqlMap" 必须匹配 DOCTYPE 根 "null"。
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:51)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:410)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
... 7 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; 文档根元素 "sqlMap" 必须匹配 DOCTYPE 根 "null"。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:157)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50)
... 10 more

错误原因:

改正:

时间: 2024-10-29 19:12:24

ibatis错误的相关文章

ibatis错误汇总

1) 错误:The prefix "context" for element "context:property-placeholder" is not bound. 解决:在文件头中引入:xmlns:context="http://www.springframework.org/schema/context" 即可. 正解例子: <beans xmlns="http://www.springframework.org/schem

MyBatis3.4.0以上的分页插件错误:Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.stateme

错误: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)] with root cause 问题

ibatis 的 &quot;This SQL map does not contain a MappedStatement&quot;的错误

This SQL map does not contain a MappedStatement named List 说明: 执行当前 Web 请求期间,出现未处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: IBatisNet.DataMapper.Exceptions.DataMapperException: This SQL map does not contain a MappedStatement named Adminf.List

mybatis错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:org.apache.ibatis.binding.BindingException: Invalid bound statement(not found) 通常原因是因为Mapper interface和xml文件的定义对不上,通常需要检查包名.namespace.函数名等. 出现这个错误的原因是我

SpringMvc错误:HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is n

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'ItemsCustom' in 'class com.mybati

ibatis.net MVC 单元测试 错误解决方法

Q1:Unable to load file via resource "SqlMap.config" as resource.Cause : 未能找到文件:"...TestResults\yonyou 2015-09-28 14_10_10\Out\SqlMap.config” A1:项目在做单元测试的时候,自动会生成一个TestResults文件夹.每次做单元测试的时候,会自动在该文件夹下生成一个文件夹,里面包含了输出文件夹,例如:\TestResults\yonyou

ibatis做批量删除遇到错误

我做的操作是每五分钟系统自动做一次批量操作. 批量操作的内容为2万条,但是每次查看数据库时候都没有操作两万条数据而只有3000条.后来看了一下错误日志 ORA-01000: maximum open cursors exceeded:查看了一下数据库游标参数设置show parameter open_cursors:我的配置为3000,后来将参数更改了一下 alter system set open_cursors = 20000:然后数据库中数据按指定规定删除,没有出现问题.

MyBtais错误:org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.a

Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) at org.springframework.beans.factor

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

我调这个bug调了一天多,在网上搜索的检查namespace,package等,都没有错.错误提示是没有找到xml文件,我就纳闷了,为什么找不到呢?后来才发现,原来是resource中奇怪的目录为题,可以看着两个链接:https://jingyan.baidu.com/article/93f9803f51225fe0e56f5573.html,https://blog.csdn.net/benben513624/article/details/81076182. 在创建resources下目录时