dom4j解析xml文件时发生must end with the ';' delimiter.的解决方法

在项目中的配置文件中有如下代码:

<set-property name="url" value="jdbc:mysql://192.168.0.123/test?user=root&password=123456"/>

在解析时,抛出异常

 

解决:

dom4j在解析xml文件时,&字符需要转义成&amp;因此改成

<set-property name="url" value="jdbc:mysql://192.168.0.123/test?user=root&amp;password=123456"/>

就可以了

猜你喜欢

转载自blog.csdn.net/zezezuiaiya/article/details/80706647