org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [XXX.xml]';

tomcat启动时报错:

Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [XXX.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 186; columnNumber: 32; 在实体引用中, 实体名称必须紧跟在 '&' 后面。

由于在mapper中用了不正确的字符
例如:
这个是错的

这里应该使用

<if test="SALER_NAME!=null and SALER_NAME!=''">
    and INSTR(i.saler_name,#{SALER_NAME})
if>

在 XML 中有 5 个预定义的实体引用:


&lt;    <   小于
&gt;    >   大于
&   &   和号
'  '   省略号
"  "   引号

或者使用XML CDATA

你可能感兴趣的:(个人,JAVA,xml)