xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter

  

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

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

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

  

 <dataSource type="POOLED">  
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/solr_db?useUnicode=true&characterEncoding=utf-8"/>
                <property name="username" value="root"/>  
                <property name="password" value="xx@"/>  
            </dataSource>  

正确的如下:

 <dataSource type="POOLED">  
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/solr_db?useUnicode=true&amp;characterEncoding=utf-8"/>
                <property name="username" value="root"/>  
                <property name="password" value="xx"/>  
            </dataSource>  

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

   

原文地址:https://www.cnblogs.com/shaosks/p/8629258.html