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单数个中文-->
    时就会报此异常
    争对此异常可以采用在左右边界加上空格的方式解决。 如像这样是对的 <!--   中文注解    -->
  • 相关阅读:
    Promise链式调用 终止或取消
    uni-app input text-indent失效解决
    从浏览器输入url到显示页面的过程 (前端面试题)
    node.js切换多个版本
    防抖和节流
    vue子组件与子组件之前传值-----最简单办法
    Element源码---初识框架
    vue中父级与子组件生命周期的先后顺序
    vscode快捷键,让你脱离鼠标,敲代码嗖嗖的
    NHibernate代码监视
  • 原文地址:https://www.cnblogs.com/grefr/p/5046335.html
Copyright © 2011-2022 走看看