### Error building SqlSession.

原创 2015年11月19日 20:06:53

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、解决办法

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

使用HttpClient时遇到的 java.net.SocketException: Socket closed异常

使用httpClient时,报 java.net.SocketException: Socket closed异常的解决

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

##报错代码 ``` org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### T...

Struts2+spring+MyBatis增删改查操作

在我的博客首页有s2sh整合的例子,现在要做的工作就是将此工程中hibernate换成mybatis,并且使用比较流行的annotation注解来实现。首先肯定是要将hibernate的jar包全部干...

Mybatis入门概述及第一个Mybatis实例实现增删改查

Mybatis入门概述及第一个Mybatis实例实现增删改查

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

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

SSM-Mybatis的SQL(增删改查)语句

id="xxx"对应为Dao层方法。须保证名字一致 一、增 传入对象,使用#{对象的属性} useGeneratedKeys ID是否自增 id="registerUser" keyPropert...

四大线程池详解

new Thread 的弊端首先看一段代码:/** * Created by Zero on 2017/8/30. */ public class ThreadTest { public ...

weblogic集群受管服务器报<Error> <Cluster> <BEA-000110><Error> <Cluster> <BEA-000109>

weblogic集群 多播 模式 受管服务器启动报 错误

【MyBatis】常见错误记录

错误类型一: 错误提示:org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause:...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)