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真的是不能再傻 ...
随机推荐
- IEEE Fellow 何海波
IEEE Fellow 何海波 11月21日,全球最大的非营利专业技术学会IEEE(电气与电子工程师协会)公布了2018年度新当选Fellow(会士)名单,我校校友何海波教授入选. 何海波,美国罗德岛 ...
- 输入www.baidu.com会发生什么
1. 浏览器接收域名 2. 发送域名给DNS,请求解析出www.baidu.com的IP地址 中文名字是域名系统服务器,一般位于ISP(互联网服务提供商,比如我们熟知的联通.移动.电信等) 中.浏览器 ...
- Natasha V1.3.6.0 的升级日志
开源库满足于个人,而完善于大众. Natasha 自稳定版发布之后,众多老铁参与增强改进,感谢如下老铁的反馈: 1. 异常搜集 在 wenjq0911 建议下,添加了异常捕获,现 Natasha 的编 ...
- JAVA中的四种JSON解析方式详解
JAVA中的四种JSON解析方式详解 我们在日常开发中少不了和JSON数据打交道,那么我们来看看JAVA中常用的JSON解析方式. 1.JSON官方 脱离框架使用 2.GSON 3.FastJSON ...
- 【转载】C#里怎么把string类型转换成double
在C#的数字计算过程中,有很多的方法可以将字符串String类型的变量转换为double类型,double.Parse方法.Convert.ToDouble方法.double.TryParse方法等都 ...
- IOS—— strong weak retain assign 学习
转自:http://wenzongliang.iteye.com/blog/1746604 简单讲strong等同retain weak比assign多了一个功能,当对象消失后自动把指针变成nil,好 ...
- 【转载】Gradle学习 第四章:安装Gradle
转载地址:http://ask.android-studio.org/?/article/16 4.1. Prerequisites 前提条件Gradle requires a Java JDK or ...
- Qt中QWidget、QDialog和QMainWindow
QWidget 类是所有用户界面对象的基类.只有一个"页面" QMainWindow 是一个"窗口".含有菜单栏.状态栏.工具栏.停靠窗口.中心窗口 QDial ...
- thinkphp整合系列之极验滑动验证码geetest
给一个央企做官网,登录模块用的thinkphp验证码类.但是2019-6-10到12号,国家要求央企检验官网漏洞,防止黑客攻击,正直贸易战激烈升级时期,所以各事业单位很重视官网安全性,于是乎集团总部就 ...
- 苹果电脑Mac系统如何安装Adobe Flash Player
一)安装/更新Adobe Flash Player 开系统偏好设置 , Flash player 更新,立即检查/立刻安装: Flash插件官方每月常规更新1~2次,为避免频繁过期,建议设置为允许A ...