mybatis解析xml配置文件出现异常:

org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession.

Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)

at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:54)

at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:38)

at com.silence.mybatis.UserTest.init(UserTest.java:33)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)

at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。

at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:256)

at org.apache.ibatis.parsing.XPathParser.

明显在解析xml配置文件的时候出现的异常,

从org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。可以明显的看出mybatis的配置文件显然是有顺序并且个数是有限定的,‘?’表示可以没有但是最多只能有一个,但是自己的配置中

明显是错误的,正确的应该这样子配置

Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xm的更多相关文章

  1. ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.

    在做多表映射查询时,在同一个resultMap中写了1:1映射和1:n映射,结果测试时报错如下: org.apache.ibatis.exceptions.PersistenceException: ...

  2. 报错 ———— Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。

    报错 <?xml version="1.0" encoding="UTF-8"?>  必须是XML文件的第一个元素且前面不能空格. ### Erro ...

  3. SpringBoot和mybatis整合报错:Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 152; columnNumber: 10; 元素类型为 "mapper"

    很明显,报错是xml有问题,于是去检查,发现: 由于粗心,保存的时候,按的太频繁,多按了个s在里面,导致启动报错!

  4. The error may exist in com/bjpowernode/dao/StudentDao.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderExcept

    The error may exist in com/bjpowernode/dao/StudentDao.xml### Cause: org.apache.ibatis.builder.Builde ...

  5. Error building SqlSession. ### The error may exist in dao/UserMapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration(2 字节的 UTF-8 序列的字节 2 无效。)

    关于在学习Mybatis框架时运行报错 Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building ...

  6. org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML.问题思路

    15:36:34,549 WARN DefaultListableBeanFactory:1416 - Bean creation exception on FactoryBean type chec ...

  7. 解决:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'requestMap.maintenancename != null and requestMap.maintenance

    异常如下:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...

  8. mybatis <fireach> 拼接sql语句 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'in'. Cause:

    <select id="getUserIn" parameterType="QueryVo" resultMap="userMap"& ...

  9. mybatis异常:nested exception is org.apache.ibatis.builder.BuilderException: Error resolving JdbcType

    异常详细 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...

随机推荐

  1. SharePoint Calculated Columns 分类: Sharepoint 2015-07-09 01:49 8人阅读 评论(0) 收藏

    SharePoint Calculated Columns are powerful tools when creating out-of-the-box solutions. With these ...

  2. (转) jsp页面 URL传中文参数到Action里面出现乱码

    jsp页面 URL传中文参数到Action里面出现乱码,方法如下: 第一种:在Action中用 new String(str.getBytes("ISO8859_1"), &quo ...

  3. ini配置文件格式

    转自:http://blog.sina.com.cn/s/blog_6988593e0101e6i4.html  程序没有任何配置文件,那么它对外是全封闭的,一旦程序需要修改一些参数必须要修改程序代码 ...

  4. Titanium studio介绍

    1.Titanium Studio 概述 TitaniumStudio是Appcelerator公司开发的一款基于Eclipse的,使开发者利用Javascript来快速开发移动应用程序的跨平台的集成 ...

  5. iOS---XMPP环境搭建过程

    什么是即时通信? 即时通信是目前Internet上最为流行的通讯方式, 各种各样的即时通讯软件也层出不穷, 服务提供商也提供了越来越枫木的通讯服务功能. 即时通讯有多重实现方式, XMPP就是其中一种 ...

  6. php绘图问题

    php绘图首先要确认gd库是否启用,到php.ini文件中,找到extension=php_gd2.dll将前面的:去掉,重新启动服务器. 如果在绘图中还是没有显示正常的图片,说明服务器在回复请求时, ...

  7. android的apk逆向工程后的文件目录介绍

    一.用压缩软件打开apk,得到五个文件或文件夹 1.META-INF 2.res 3.AndroidManifest.xml 4.classes.dex 5.resources.arsc 二.xml文 ...

  8. hash表C语言实现

    算法参考<算法导论>第11章散列表.采用链地址法解决冲突. #include <stdio.h> #include <stdlib.h> #include < ...

  9. Web测试中常见分享问题

         Web测试中,由于开发通常指注重完成H5页面的逻辑功能,对各种系统.浏览器等考虑不周,同时Android端各类机型碎片化,容易产生兼容性问题,这其中以分享类型为最. 本文简单分析总结一些测试 ...

  10. runtime作用

    1.发送消息 方法调用的本质,就是让对象发送消息. objc_msgSend,只有对象才能发送消息,因此以objc开头. 使用消息机制前提,必须导入#import <objc/message.h ...