java报错:The reference to entity "characterEncoding" must end with the ';' delimiter.
java关于报错:The reference to entity "characterEncoding" must end with the ';' delimiter.
Java 解析XML文件错误。
错误信息提示代码类似如下:
The reference to entity "characterEncoding" must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.
或
ontext initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.
纠错结果:
在配置一个访问数据库的Url时,第一次设置的内容如下:
jdbc:mysql://localhost:3306/photo?useUnicode=true&characterEncoding=UTF-8,注意中间那个“&”,在xml中这个是读不出的,正确写法将“&”转义“&”:
jdbc:mysql://localhost:3306/photo?useUnicode=true&characterEncoding=UTF-8
分析:
有时候在使用xml作为配置文件的时候,应该要使用xml的编码规则来进行适当的设置。
下面给出xml中一些特殊符号的编码转换:
< | < | 小于号 |
> | > | 大于号 |
& | & | and字符 |
' | ' | 单引号 |
" | " | 双引号 |
---------------------
作者:杨四郎2018
来源:CSDN
原文:https://blog.csdn.net/yang5726685/article/details/56015938
版权声明:本文为博主原创文章,转载请附上博文链接!
java报错:The reference to entity "characterEncoding" must end with the ';' delimiter.的更多相关文章
- 在java的xml文件配置数据库URL地址时提示The reference to entity "characterEncoding" must end with the ';' delimiter.错误信息
配置数据库的URL<property name="url" value="jdbc:mysql://127.0.0.1:3306/micro_message&quo ...
- The reference to entity "characterEncoding" must end with the ';' delimiter
数据源配置时加上编码转换格式后出问题了: The reference to entity "characterEncoding" must end with the ';' del ...
- xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter
数据源配置时加上编码转换格式后出问题了: The reference to entity"characterEncoding" must end with the ';' deli ...
- The reference to entity "characterEncoding" must end with the ';' delimiter (Mybatis + Mysql)
数据源配置时加上编码转换格式后出问题了: The reference to entity "characterEncoding" must end with the ';' del ...
- 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 Sourc ...
- 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';' delimiter.)
这次在配置xml文件时,出现错误提示( The reference to entity “useSSL” must end with the ‘;’ delimiter.) 报错行为 <prop ...
- 配置c3p0-config.xml数据库连接池,jdbcurl配置项报错Type The reference to entity "useUnicode" must end with the ';' delimiter.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xml> <c3p0-confi ...
- java 报错及解决
java文件编译报错:error: unmappable character for encoding ASCII 解决: 编译时:javac -encoding utf-8 TestJava.jav ...
- [java报错]Could not instantiate listener XXXXXX
写在开头的话: 兜兜转转,辞去了深圳的工作,回到了武汉,从事的居然一度是我最不想学的语言-java,曾经以为自己并不会java,但是上手之后,发现语言都是相通的,自己一度排斥学习java真的是不能再傻 ...
随机推荐
- 在普通网页显示正常,加Https报This request has been blocked; the content must be served over HTTPS.,https网站加载http资源时,http资源被block
解决办法 :在html头加<meta http-equiv="Content-Security-Policy" content="upgrade-insecure- ...
- microsoft.extensions.logging日志组件拓展(保存文本文件)
Microsoft.Extensions.Logging 日志组件拓展 文件文本日志 文件文本日志UI插件 自定义介质日志 Microsoft.Extensions.Logging.File文件文本日 ...
- C# 简单日志帮助类LogHelper
调用: LogHelper.Debug(""); LogHelper.Info(""); LogHelper.Error(""); 项目添加 ...
- Linq 用得太随意导致的性能问题一则
问题场景 有一个很多条数据的数据库(数据源),在其中找出指定的项,这些项的 ID 位于 给定的列表中,如 TargetList 中. private readonly IDictionary<s ...
- Gin-Go学习笔记一:Hello World
Hello World 1> Gin是一个golang的微框架,封装比较优雅,API友好.具有快速灵活,容错方便等特点.Gin自身的net/http足够简单,性能也非常不错. 2> ...
- 【软件工程第三次作业】结对编程:四则运算( Java 实现)
1. GitHub 地址 本项目由 莫少政(3117004667).余泽端(3117004679)结对完成. 项目 GitHub 地址:https://github.com/Yuzeduan/Arit ...
- Ambari 管理hadoop、hbase、zookeeper节点
简介: Apache Ambari是一种基于Web的工具,支持Apache Hadoop集群的供应.管理和监控.Ambari已支持大多数Hadoop组件,包括HDFS.MapReduce.Hive.P ...
- C# Net 通用json转Object(对象)
C# Net 通用 json 转 Object 对象 C# Net 提取 json 字符串 对象 数组 C# Net json 对象 中有字符串 转为 对象 例如输入:{"1" ...
- C#使用Xamarin开发移动应用 ---- 系列文章
C#使用Xamarin开发移动应用 C#使用Xamarin开发可移植移动应用终章(11.获取设备信息与常用组件,开源一个可开发模版.) C#使用Xamarin开发可移植移动应用进阶篇(10.综合演练, ...
- php提示Undefined index的解决方法
我们在做php开发时有时可能会提示Notice: Undefined index: *** on line 249,出现上面这些是 PHP 的提示而非报错,PHP 本身不需要事先声明变量即可直接使用, ...