`
sundful
  • 浏览: 1245536 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

The reference to entity "characterEncoding" must end with the ';' delimiter

 
阅读更多

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;

"

双引号

分享到:
评论

相关推荐

    Linq to sql 和 Linq to Entity 高级查询

    实现linq多个查询条件连接功能(支持linq to sql 和linq to entity)。 按多个指定属性排序功能。 不同参数的lamdba表达式条件间的转换功能。

    Entity.Framework.Tutorial.2nd.Edition.1783550015

    A comprehensive guide to the Entity Framework with insight into its latest features and optimizations for responsive data access in your projects About This Book Create Entity data models from your ...

    JsonToEntity JSON实体类生成工具 V1.0

    JSONToEntity是一款基于.NET 4.0框架的实用工具,主要功能是将JSON字符串自动转换为对应的C#实体类,极大地简化了开发者的工作流程。在处理JSON数据时,通常需要手动创建与之匹配的C#类,这个工具则能够自动生成这些...

    Linq to Entity

    【Linq to Entity】是一种在.NET Framework中用于与关系数据库交互的技术,它是Language Integrated Query (LINQ)的一部分,专门用于实体框架(Entity Framework)。通过Linq to Entity,开发者可以使用C#或VB.NET等...

    Json转为类对象-JsonToEntity

    C#:此小程序实现将复杂的 json 格式数据转换为对应的实体类对象,对象与对象之间的关系采用了 ImplementFactory 组件提供的 Constraint 属性,可以在 Visual Studio 里使用 Nuget 搜索并引用该组件,该组件可实现...

    Chinese Entity Linking Comprehensive

    referred to in each query has a matching entity node in the reference Knowledge Base (KB) (LDC2014T16). If there is a matching node for a query, annotators create a link between the two. If there is ...

    ASP.NET MVC with Entity Framework and CSS

    People wanting to learn ASP.NET MVC and Entity Framework ranging from novice developers new to the subject through to more experienced ASP.NET web forms developers looking to migrate from web forms to...

    flex 中 && 符号的写法

    如果你遇到这样的问题: The entity name must immediately follow the '&' in the entity reference 说明你的& 符号写的有问题

    MVC+Linq to Entity音乐商店源码20130403

    这是一个基于ASP.NET MVC框架和Linq to Entity的数据访问技术实现的音乐商店源代码项目,发布于2013年4月3日。这个项目旨在提供一个基础的音乐商品管理平台,用户可以进行音乐商品的分类浏览和管理。下面将详细阐述...

    Wrox.Professional.ADO.NET.3.5.with.LINQ.and.the.Entity.Framework.Feb.2009.rar

    《Wrox Professional ADO.NET 3.5 with LINQ and the Entity Framework》是针对.NET Framework 3.5中数据访问技术的重要参考资料。该书详细介绍了ADO.NET 3.5、LINQ(Language Integrated Query)以及Entity ...

    SSD7 选择题。Multiple-Choice

    For two tables to be union compatible, the tables should be the same with respect to which of the following? (a) keys (b) cardinality (c) name (d) degree Correct answer is (d) Your ...

    Wrox.Professional.ADO.NET.3.5.with.LINQ.and.the.Entity.Framework.Feb.2009

    《Wrox Professional ADO.NET 3.5 with LINQ and the Entity Framework》是针对.NET Framework 3.5中数据访问技术的重要参考资料。本书深入探讨了ADO.NET 3.5、LINQ(Language Integrated Query,语言集成查询)以及...

    CVS to Entity Framework

    【CVS to Entity Framework】是将CSV(逗号分隔值)文件的数据转换为C#实体类,并利用Entity Framework进行数据库操作的过程。这个过程通常包括以下几个关键步骤: 1. **CSV解析**:首先,我们需要解析CSV文件,这...

    Pro Entity Framework Core 2 for ASP.NET Core MVC

    Model, map, and access data effectively with Entity Framework Core 2, the latest evolution of Microsoft’s object-relational mapping framework that allows developers to access data using .NET objects,...

    Java_for_the_Web_with_Servlets

    "Java for the Web with Servlets, JSP, and EJB: A Developer’s Guide to J2EE Solutions" by Budi Kurniawan is a comprehensive guide aimed at helping developers master web programming in Java. The book ...

    Mastering Entity Framework(PACKT,2015)

    Data access is an integral part of any ... You'll learn how to retrieve data by querying the Entity Data Model and understand how to use LINQ to Entities and Entity SQL to query the Entity Data Model.

    Entity Framework Core Cookbook - Second Edition 2016

    The book will then explain how to work with transactions and stored procedures along with improving Entity Framework using query libraries. Moving on, you will learn to improve complex query ...

    Code-First Development with Entity Framework

    This book will help you acquire the necessary skills to program your applications using Entity Framework. You will start with database configuration and learn how to write classes that define the ...

Global site tag (gtag.js) - Google Analytics