MyBaties 错误The content of elements must consist of well-formed character data or markup.

The content of elements must consist of well-formed character data or markup.

原因:xml中的书写规范不正确或者有非法的字符

    <select id="queryRegType" parameterType="MeetingRegTypeFee"  resultType="MeetingRegTypeFee">
        SELECT REG_TYPE,FEE
        FROM PM.T_MEETING_REGTYPE_FEE
        WHERE
        BEGIN_TIME < =  systimestamp
        AND END_TIME > =  systimestamp - 1
        AND MEETING_ID = #{meetingId}
        AND DEL_FLAG = ‘0‘ 

    </select>

在该xml中‘<‘和‘>‘ 非法   故报以上错误

正确写法

    <select id="queryRegType" parameterType="MeetingRegTypeFee"  resultType="MeetingRegTypeFee">
        SELECT REG_TYPE,FEE
        FROM PM.T_MEETING_REGTYPE_FEE
        WHERE
        <![CDATA[
        BEGIN_TIME < =  systimestamp
        AND END_TIME > =  systimestamp - 1
        ]]>
        AND MEETING_ID = #{meetingId}
        AND DEL_FLAG = ‘0‘ 

    </select>

即对特殊字符用CDATA部件进行转义

一个 CDATA 部件以"<![CDATA[" 标记开始,以"]]>"标记结束

时间: 2024-11-06 18:46:33

MyBaties 错误The content of elements must consist of well-formed character data or markup.的相关文章

Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.    at org.apache.ibatis.parsing.XPathParser.

Caused by: org.xml.sax.SAXParseException: The content of elements must consist of well-formed charac

启动tomcat后,console报错如下: Caused by: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. 由于这种错误都犯了几次,现在把问题记录下来. 第一种产生的原因是:sql中的大于号(>)或(<)小于号没有进行转义. XML只有5个转义符:<,>,&,",?;的转义字符分别如下:

ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data... 2012-07-18 11:21wuming3632171 | 浏览 5114 次 ibatis配置如下,高手帮我看看.<select id="exportRecieveData" parameterClass="java.util.HashMap"resultClass="

Mybatis 异常: The content of elements must consist of well-formed character data or markup

今天用mybatis弄一个小玩意,发现Mapper中以下语句报错,且会导致Tomcat无法正常启动 <select id="getAmountByTimePeriod" resultMap="seatHisAmountMap"> select sum(nightFare) as nightAmount , sum(fare) as seatAmount ,#{0} as starttime, #{1} as endtime from nightfare

关于找不到布局的错误android.content.res.Resources$NotFoundException: Resource ID #0x7f05003e type #0x12 is not valid

今天遇到这个错误,android.content.res.Resources$NotFoundException: Resource ID #0x7f05003e type #0x12 is not valid 我在R文件中找到了这个这个ID的源  原来是一个布局文件,我给他定义了ID直接进行引用(很蠢是不是,新手嘛) 然后就冒了这个错 改正方法  将R.id.资源改成 R.layout.资源 就ok了  其他人未必是这么改  请勿照猫画虎

错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure.......

服务器是:https的,然后七牛云用了http,就会报错,所以,需要换成https,就可以了. 原文地址:https://www.cnblogs.com/zxyun/p/12394739.html

mybatis--Mapper 常见报错总结(持续总结)

本文版权归 远方的风lyh和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 1.The content of elements must consist of well-formed character data or markup XML 元素必须遵循以下命名规则: 1.名称可以含字母.数字以及其他的字符 2.名称不能以数字或者标点符号开始 3.名称不能以字符 "xml"(或者 XML.Xml)开始 4.名称不能包含空格 场景 小于号 '<' 需要转义 2.

mybaits不能出现小于号

org.xml.sax.SAXParseException; lineNumber: 146; columnNumber: 54; The content of elements must consist of well-formed character data or markup. 配置文件如下 <select id="selectLastestBuildByGroupDt" resultMap="BaseResultMap"> SELECT * F

mybatis 的 &lt;![CDATA[ ]]&gt; 标签作用

有个细节一直没有注意到,今天mark一下: mybatis进行时间比较的时候我们会这么写,一直都是在复制粘贴所以没有注意,一个标签<![CDATA[ ]]> 今天在做另外一个有时间比较sql的时候,xml一直报如下错: The content of elements must consist of well-formed character data or markup 检查没有xml标签问题,后来才注意到原来是没加<![CDATA[ ]]>标签导致: 因为这个是xml格式的,所以