Recently, when using the ibatis component for a project development, the following error message is displayed:
Type exception report
Message
Description the server encountered an internal error () and the request could not be completed.
Exception
Javax. servlet. servletexception: Root Cause of Java. Lang. exceptionininitializererror
Root Cause of Java. Lang. exceptionininitializererror
Java. lang. runtimeexception: error occurred. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Java. lang. runtimeexception: Error parsing XPath '/sqlmapconfig/sqlmap '. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Org. XML. sax. saxparseexception: the string "--" is not permitted within comments. root Cause
Com. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Java. lang. runtimeexception: Error parsing XPath '/sqlmapconfig/sqlmap '. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Org. XML. sax. saxparseexception: the string "--" is not permitted within comments. root Cause
Java. lang. runtimeexception: Error parsing XPath '/sqlmapconfig/sqlmap '. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Org. XML. sax. saxparseexception: the string "--" is not permitted within comments. root Cause
Com. ibatis. Common. xml. nodeletexception: Error parsing XML. Cause: org. xml. Sax. saxparseexception: the string "--" is not permitted within comments. Root Cause
Org. xml. Sax. saxparseexception: the string "--" is not permitted within comments.
-----------------------------------------------------
The error description shows the exception caused by the comment in the XML file. You can use
Later it was found that the configuration file was used: After the singular Chinese characters or letters were followed by a single Chinese character, and then "-->" was used to end the comment (without spaces after the Chinese characters)
Example: <! -- Singular Chinese -->, <! -- A singular Chinese -->
This exception will be reported
For this exception, you can add spaces on the left and right boundary. This is correct, for example <! -- Chinese annotation -->