Ibatis xml configuration file annotation causes errors and Solutions

Source: Internet
Author: User

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 -->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.