关闭

### Error building SqlSession.

标签: Mybatis
8426人阅读 评论(2) 收藏 举报

1、错误描述

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 93; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:79)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:63)
	at com.you.demo.Mybatis.main(Mybatis.java:45)
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 93; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:253)
	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:122)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:72)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:76)
	... 2 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 93; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:890)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1547)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1319)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:251)
	... 5 more

2、错误原因

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
    <environments default="development">
        <transactionManager type="JDBC"/>
        <dataSource type="POOLED">
            <property name="driver"
                value="com.mysql.jdbc.Driver"/>
            <property name="url" 
                value="***************"/>
            <property name="username" value="**************"/>
            <property name="password" value="*************"/>
        </dataSource>
    </environments>
</configuration>


3、解决办法

1
20
查看评论

MyException--org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ###

org.apache.ibatis.exceptions.PersistenceException:  ### Error building SqlSession. ### The error may exist in cn/itcast/mybatis/mapper/OrdersMa...
  • xiaoye142034
  • xiaoye142034
  • 2017-05-27 22:25
  • 2079

初学Mybatis时遇到 Error building SqlSession.的原因,看了半天,终于成功解决了

1、我出现的的错误 Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: org.apache.ibatis.exceptions.PersistenceException: #...
  • IT_admin_boss
  • IT_admin_boss
  • 2017-11-16 11:06
  • 750

org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may

##报错代码 ``` org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in com/scarecrow/mapper/OrdersM...
  • qq_29154373
  • qq_29154373
  • 2017-05-28 14:23
  • 4092

myBatis源码学习之SqlSessionFactoryBuilder

/* * Builds {@link SqlSession} instances. * */ /** * @author Clinton Begin */ public class SqlSessionFactoryBuilder { public SqlSessionFactory...
  • qq924862077
  • qq924862077
  • 2015-12-30 20:03
  • 4965

【MyBatis】常见错误记录

错误类型一: 错误提示:org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException:...
  • u010107350
  • u010107350
  • 2016-06-05 10:22
  • 10391

org.apache.ibatis.exceptions.PersistenceException:解决方法

在写第一个mybatisDemo,一下子报出这么多错误org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in com/mybatis/m...
  • jyxmust
  • jyxmust
  • 2017-02-14 11:53
  • 29044

学习mybatis框架中遇到org.apache.ibatis.exceptions.PersistenceException: 问题该怎么解决

org.apache.ibatis.exceptions.PersistenceException: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The err...
  • lkwan123
  • lkwan123
  • 2017-03-01 09:47
  • 29027

org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.

研究了几个月的android 最近这段时间回顾了一下java知识,发下有一些知识已经忘记了,不由自主的感慨一下,要想当一名优秀的程序员是很痛苦的,你必须不断学习新技术来赶上时代的脚步,同时你必须不断温习以前学的技术点来保持的自己优秀的状态,尽管这样很累,但这些努力会已其他方式一点一滴的回报自己,好了...
  • haidaoduozhu
  • haidaoduozhu
  • 2017-01-07 10:21
  • 3804

SAXParseException:前言中不允许有内容

今天打开eclipse时,显示:发生了错误。请参阅日志文件D:\eclipse\Workspace\.metadata\.log。然后打开日志:problems readiing information from XML:'OpenTypeHistory.xml',更改了该配置文件的...
  • u010097777
  • u010097777
  • 2016-12-13 23:10
  • 2348

### Error building SqlSession.

1、错误描述Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ib...
  • you23hai45
  • you23hai45
  • 2015-11-19 20:06
  • 8426
    个人资料
    • 访问:5585820次
    • 积分:72993
    • 等级:
    • 排名:第28名
    • 原创:1925篇
    • 转载:76篇
    • 译文:3篇
    • 评论:1193条
    百度技术栏目
    网易博客
    新浪博客
    博客专栏
    Linux

    文章:47篇

    阅读:66360
    dojo

    文章:10篇

    阅读:30491
    Flex

    文章:13篇

    阅读:29354
    FusionCharts

    文章:14篇

    阅读:71474
    文章分类
    最新评论