zoukankan      html  css  js  c++  java
  • Ibatis XML 配置文件注释引起错误及解决方案

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp35

    Ibatis XML 配置文件注释引起错误及解决方案
    最近在使用Ibatis组件进行一个项目开发,在运行时发现提示如下错误信息:
    type 异常报告
    消息
    描述服务器遇到一个内部错误 (), 无法完成此请求。
    异常
    javax.servlet.ServletException: java.lang.ExceptionInInitializerError根本原因
    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.根本原因
    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.根本原因
    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.根本原因
    com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: The string "--" is not permitted within comments.根本原因
    org.xml.sax.SAXParseException: The string "--" is not permitted within comments.

    -----------------------------------------------------
    从错误描述来看发现是XML文件中的注释引起的异常,去掉配置文件中的中文注释或改用英文描述则可以通过
    后来发现是配置文件中采用:单数个中文或字母后跟单数个中文再用“-->”结束注释(中文后不加空格)
    如:<!-- 单数个中文-->、<!-- a单数个中文-->
    时就会报此异常
    争对此异常可以采用在左右边界加上空格的方式解决。 如像这样是对的 <!--   中文注解    -->
  • 相关阅读:
    codeforces 466D
    codeforces 360B
    codeforces 383D
    codeforces 679B
    codeforces 571B
    codeforces 494B
    CodeForces 660D Number of Parallelograms(n个点所能组成的最多平行四边形数量)
    算法竞赛模板 最短路
    算法竞赛模板 string中substr函数的运用
    HDOJ 1269 迷宫城堡(tarjan模板题)
  • 原文地址:https://www.cnblogs.com/grefr/p/5046335.html
Copyright © 2011-2022 走看看