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

出现如下异常:

 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

]]>

包裹着。

来源://作者:/更新时间:2012-12-19
相关文章
评论:
验证码:
匿名评论:

最新文章

文章排行