mybatis 中 出现 < > 号情况

来源:互联网 发布:ps4 pro优化游戏 编辑:程序博客网 时间:2024/05/22 09:42

spring +mybatis 出现The content of elements must consist of well-formed character data or markup 解决

上一篇: java.lang.AssertionError 传递
下一篇:spring Bean property 'backupSe

出现如下异常:

 nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:naviserversrcSSVImageBackupBatchbinjppioneerncsssvresourcescommonmybatisImageMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

在ibatis的映射文件中出现了特殊字符的情况下会出现以上错误。

特殊字符有:  < 小于号 ,>大于号等

要用

<![CDATA[

select * from tb_users where id<=100

]]>

包裹着。