本文转自http://liuzhaodong89.iteye.com/blog/1559998;
今天修改了配置文件中的一个配置项值,将原先的url连接中加入了一个&source=upload,结果在应用启动的时候报错了。错误栈如下:
- Caused by: org.xml.sax.SAXParseException: The reference to entity "test" must end with the ';' delimiter.
- at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
- at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
- at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
- at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
- at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
- at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
- at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
- at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
- at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
- at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
- at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:361)
- ... 176 more
上网google,发现是sax解析造成的问题。解决方案很简单,就是把配置项值中用到"&"的地方改成"&"。原因是sax解析的类库在读取文件的时候是根据转义后的格式进行读取的,遇到"&"就认为是一个转义字符串,开始找结束符";",找不到自然就报错了。
相关推荐
实现linq多个查询条件连接功能(支持linq to sql 和linq to entity)。 按多个指定属性排序功能。 不同参数的lamdba表达式条件间的转换功能。
C#:此小程序实现将复杂的 json 格式数据转换为对应的实体类对象,对象与对象之间的关系采用了 ImplementFactory 组件提供的 Constraint 属性,可以在 Visual Studio 里使用 Nuget 搜索并引用该组件,该组件可实现...
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 ...
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 ...
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...
如果你遇到这样的问题: The entity name must immediately follow the '&' in the entity reference 说明你的& 符号写的有问题
数据库连接 Linq to Entity
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
Take your data access skills to the next level with Entity Framework About This Book Learn how to create, retrieve, update, and delete the data in a relational database using .NET Choose from an ...
The book focuses on the essentials of using WCF and Entity Framework, rather than providing a reference to every single possibility. It leaves the reference material online where it belongs, and ...
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,...
An Efficient Zero-shot-capable Approach to End-to-End Entity
Armed with this experience, you will be ready to dive deep into Entity Framework, experiment with new approaches, and develop ways to solve even the most difficult data access challenges. If you are ...
Name ambiguity problem has ...with the classical BOW based methods and social network based methods, our method can significantly improve the disambiguation performance by respectively 8.7% and 14.7%.
Wrox.Professional.ADO.NET.3.5.with.LINQ.and.the.Entity.Framework.Feb.2009.rar
对于linq to entity的语法的介绍以北风网为例子
Wrox.Professional.ADO.NET.3.5.with.LINQ.and.the.Entity.Framework.Feb.2009
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 ...
Starting with the basics, you will then dive into the advanced concepts and features of LINQ to Entities, including Entity Framework, deferred execution, querying a view, and mapping a procedure....
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 ...