The reference to entity "characterEncoding" must end with the ';' delimiter
来源:互联网 发布:冰箱品牌 知乎 编辑:程序博客网 时间:2024/03/28 16:35
Caused by: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.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 javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.validateResource(PersistenceUnitReader.java:187)
at org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.readPersistenceUnitInfos(PersistenceUnitReader.java:138)
... 48 more
JPA persistence xml 中报错的写法:
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8" />
正确的写法:
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8" />
注意有些时候,hibernate的某些版本,不支持value属性,需要写成这样的形式:
<property name="hibernate.connection.url" > jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8</property>
在xml文件中有以下几类字符要进行转义替换:
<
<
小于号
>
>
大于号
&
&
和
'
'
单引号
"
"
双引号
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter.
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- .The reference to entity "characterEncoding" must end with the ';' delimiter.
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter.
- Java基础教程 - 编程语言的发展
- 我犯的低级错误
- (step6.3.2)hdu 1068(Girls and Boys——二分图的最大独立集)
- android反编译工具总结
- flashcache中应用device mapper机制
- The reference to entity "characterEncoding" must end with the ';' delimiter
- linux下的C语言开发(自动编译工具)
- C语言深度解剖读书笔记(8.以后的c语言学习计划)
- Android APK反编译详解(附图)
- 磨剑三载,且看从容应对14.3万TPS的Twitter是怎样炼成的!
- IntelliJ IDEA 12 创建Web项目 教程 超详细版
- java抓取土豆视频地址
- iOS 开发者必不可少的 75 个工具
- 浙江大学PAT上机题解析之2-06. 数列求和