今天工作时,在xml中写了一个简单的查询后,启动项目时突然报Failed to parse mapping resource:‘file[D:\tomcat\webapps\hongli\WEB-INF\classes\com\hongli\ota\persistence\config\product\OtaLogMapper.xml]’;nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 109; columnNumber: 82; The content of elements must consist of well-formed character data or markup.
这个问题,意思是:OtaLogMapper.xml这个文件中的109行的格式写错了;
OtaLogMapper.xml中报错的地方:
where notify_flag = false and retry_dt_next is not null and retry_dt_next < now()
在这里是“<”号出了问题。
解决方法:
1、<进行转义
where notify_flag = false and retry_dt_next is not null and retry_dt_next < now()
2、用<![CDATA[retry_dt_next < now()]]>对其进行标记
where notify_flag = false and retry_dt_next is not null and <![CDATA[retry_dt_next < now()]]>
3、将“<”改为“>”号
where notify_flag = false and retry_dt_next is not null and now() > retry_dt_next