让人哭笑不得的 The value of attribute "value" associated with an element type "prope

今天遇到了这个错误:org.xml.sax.SAXParseException: The value of attribute "value" associated with an element type "property" must not contain the '<' character.

折腾了大半天!

排除了编码问题,如果xml文件是utf-8编码但带BOM 的话,就会有这样的错误:

Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.

那么我确定xml编码没问题后,仍然出现org.xml.sax.SAXParseException: The value of attribute "value" associated with an element type "property" must not contain the '<' character. 这是什么原因呢??? 仔细检查配置文件,没有“<”这样的特殊字符啊。后来才想起来,配置文件中的数据库里的用户名和密码是加密过后的,加密过后的密码确实没有“<”,可是密码原文坑爹的就是带有 “<”字符的啊!!!

那么,在加密之前,数据库密码中的特殊字符就应该先转义下,再加密,替换了下加密字符。问题解决了。

万恶的 xml 文件就应该被淘汰吧。。。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值