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单数个中文-->
    时就会报此异常
    争对此异常可以采用在左右边界加上空格的方式解决。 如像这样是对的 <!--   中文注解    -->
  • 相关阅读:
    Ruby的Integer数据类型
    InfoPath设计优化
    深入浅出SharePoint——TimeJob编程
    深入浅出SharePoint——操作Item权限类
    深入浅出Powershell——添加用户或群组到群组中
    深入浅出PowerShell——更新List Item中的PeopleandGroup 域值
    使用TimeJob
    深入浅出InfoPath——动态获取InfoPath中的命名空间
    ContentType大展拳脚——定义List
    PowerShell深入浅出——增加账号到管理员群组
  • 原文地址:https://www.cnblogs.com/grefr/p/5046335.html
Copyright © 2011-2022 走看看