The sql statement in mybatis xml reports an error: Error creating document instance. Cause: org.xml.sax.SAXPa

Started tomcat in the morning and found that it could not be started, and reported an error: Error creating document instance. Cause: org.xml.sax.SAXParseException. It seems that there is an error in XML parsing, but no configuration file has been changed. Later, I found that I wrote an SQL last night, but I didn't test it. Open it because " < " and " > " are used in mybatis . It is estimated that there is a problem with mysql parsing. Solution:

 

1. Use transfer characters instead

< <
>
& &
'
"

2. Use the <![CDATA[sql      ]]> tag

    例如: select * from table where 

        <![CDATA[

             id <= 3  ]]>
        

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326611961&siteId=291194637