zoukankan      html  css  js  c++  java
  • 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&amp;characterEncoding=utf-8" />

    在xml文件中有以下几类字符要进行转义替换:

    &lt;

    <

    小于号

    &gt;

    >

    大于号

    &amp;

    &

    &apos;

    '

    单引号

    &quot;

  • 相关阅读:
    [转]create a basic sql server 2005 trigger to send email alerts
    SDUT OJ 2783 小P寻宝记
    联想杨元庆:互联网不包治百病 概念被夸大
    【Stackoverflow好问题】Java += 操作符实质
    poj 2513 Colored Sticks (trie 树)
    Nginx基础教程PPT
    POJ 1753 Flip Game (DFS + 枚举)
    poj 3020 Antenna Placement (最小路径覆盖)
    Unable to boot : please use a kernel appropriate for your cpu
    HDU 2844 Coins (多重背包)
  • 原文地址:https://www.cnblogs.com/azhqiang/p/5430172.html
Copyright © 2011-2022 走看看