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

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

数据源配置时加上编码转换格式后出问题了:

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

这个错误就是 context.xml中设置数据源链接URL的问题

<context-param>

<param-name>url</param-name>

<param-value>jdbc:mysql://localhost:3306/bookstore?useUnicode=true&characterEncoding=UTF-8</param-value>

</context-param>

正确的如下:

<context-param>

<param-name>url</param-name>

<param-value>jdbc:mysql://localhost:3306/bookstore?useUnicode=true&amp;characterEncoding=UTF-8</param-value>

</context-param>

这大概是由xml文件中的编码规则决定要这么变换。

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

&lt;

<

小于号

&gt;

>

大于号

&amp;

&

&apos;

单引号

&quot;

"

双引号

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

时间: 2024-08-06 11:23:42

报错The reference to entity "characterEncoding" must end with the ';' delimiter的相关文章

The reference to entity &quot;characterEncoding&quot; must end with the &#39;;&#39; delimiter.

<property name="url" value="jdbc:mysql://localhost:3306/ceshi?useUnicode=true&characterEncoding=utf8" /> 一个正常的MySQL配置却一直报错: The reference to entity "characterEncoding" must end with the ';' delimiter. 逐步深究出在xml配置文件中

Caused by: org.xml.sax.SAXParseException: The reference to entity &quot;characterEncoding&quot; must end with the &#39;;&#39; 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.XMLError

The reference to entity &quot;characterEncoding&quot; must end with the &#39;;&#39;

在配置数据库连接池数据源时,本来没有错误,结果加上编码转换格式后eclipse突然报错: 这是怎么回事? 经过查询,发现这个错误其实很好解决. 首先,原因是: .xml文件中 ‘ & ’字符需要进行转义!!! 看到这里,其实已经恍然大悟,那么,这个字符 ‘ & ’ 需要怎么转义呢?看下面这张表: 在xml文件中有以下几类字符要进行转义替换: 所以,我们在xml文件中不能直接写 ‘ & ’ 字符,而需要写成 ‘ & ’ <?xml version="1.0&q

linux + eclipse + cdt 报错undefined reference......好麻烦的,这位大牛给出的方法可行,特此MARK!!!!

http://bbs.csdn.net/topics/390239632 kerosun kerosun 等级: 结帖率:96.92% 楼主 发表于: 2012-10-11 12:00:51 比如有一个tools工程,提供给其他工程通用的工具函数. 我现在的做法就只能是ctrl+c|ctrl+v一旦工具函数发生变化,还需要在用到这些函数的工程中更新,比较麻烦. 看到eclipse工程属性设置中有Project References,但是一直不会用.那位好心人能说说怎样实现我的需求. 更多0分享到

升级redis3.2.7编译报错“ undefined reference to `clock_gettime&#39;”

由于redis有个紧急的安全漏洞更新所以我升级线上的redis-cluster的版本.编译时报了一个错:" redis-3.2.7/deps/jemalloc/src/nstime.c:120: undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[1]: *** [redis-server] Error 1 make[1]: Leaving directory `redis-3.2.7/s

报错:System.Data.Entity.Validation.DbEntityValidationException: 对一个或多个实体的验证失败

使用MVC和EF,在保存数据的时候报错:System.Data.Entity.Validation.DbEntityValidationException: 对一个或多个实体的验证失败.有关详细信息,请参阅"EntityValidationErrors"属性. 日志记录中,出错的地方在result += db.SaveChanges();所在行,尝试如下操作: →使用try...catch捕获→在catch所在行打上断点,运行,F11,对ex变量添加监视→在EntityValidati

cocos2d-x android 添加新场景报错: undefined reference to `vtable for XXX&#39;

转载自 居家懒人 http://www.cnblogs.com/JD85/archive/2012/09/17/2688128.html 加入写了新场景SecondScene,结果在cpp文件里类名地方报错说undefined reference to `vtable for SecondScene', 很简单,貌似是每个新场景都要先注册一下,找到jni-->Classes目录下的Android.mk文件,在 LOCAL_SRC_FILES := AppDelegate.cpp HelloWor

安装mysql_sniffer报错undefined reference to symbol &#39;[email&#160;protected]@GLIBC_2.2.5&#39;问题

按照https://github.com/Qihoo360/mysql-sniffer上的安装方法进行安装,make是报错如下 Linking CXX executable mysql-sniffer /usr/bin/ld: /root/mysql-sniffer/lib/libgthread-2.0.a(gthread-impl.o): undefined reference to symbol '[email protected]@GLIBC_2.2.5' //usr/lib64/libp

在配置XML时报的The reference to entity &quot;dataSource&quot; must end with the &#39;;&#39; delimiter错误

<?xml version="1.0" encoding="UTF-8"?> <ECharts> <element>http://localhost:8080/EChartDynamic/DEcharts_bar1?flag=teacher_sex&dataSource=UTADB</element> <element>http://localhost:8080/EChartDynamic/DEch