必须为元素类型 "mapper" 声明属性 "namespace" 或The content of element type "mapper" must match "EMPTY"

 
  1.  
    <?xml version="1.0" encoding="UTF-8"?>
  2.  
    <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
  3.  
    <mapper namespace = "com.introduce.Modle.User2">
  4.  
    <resultMap type="com.introduce.Model.User2" id="user2ResultMap">
  5.  
    <result property="name" column="name" />
  6.  
    <result property="age" column="age" />
  7.  
    <result property="sex" column="sex" />
  8.  
    </resultMap>
  9.  
    <select id="getUser2" resultMap="user2ResultMap">
  10.  
    <![CDATA[select * from User2 where name=#{name}]]>
  11.  
    </select>
  12.  
     
  13.  
    </mapper>

只需把<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">

这行中的两处config  改成mapper即可

namespace" 或The content of element type "mapper" must match "EMPTY"的更多相关文章

  1. Multiple annotations found at this line: - The content of element type "mapper" must match "EMPTY". - Attribute "namespace" must be declared for element type "mapper".

    今天在mybatis的mapper映射配置文件中遇到了这样的问题,困扰了我3个小时: Multiple annotations found at this line: - The content of ...

  2. The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProv

    在mybatis配置文件config.xml中报错: The content of element type "configuration" must match "(p ...

  3. The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC & ...

  4. 【转】The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...

    [转]The content of element type "configuration" must match "(properties?,settings?,typ ...

  5. The content of element type "package" must match "(result-types?,interceptors?...

    错误:“The content of element type "package" must match "(result-types?,interceptors?,de ...

  6. web.xml配置bug之提示The content of element type "web-app" must match "(icon?,display- name?,description?,distributable?,

    错误:配置web.xml时,出现红色叉叉,提示 The content of element type "web-app" must match "(icon?,disp ...

  7. The content of element type "beans" must match "(description?,(import|alias|bean)*)

    The content of element type "beans" must match "(description?,(import|alias|bean)*) - ...

  8. The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global- results?,global-exception-mappings?,action*)".

    报错 The content of element type "package" must match "(result-types?,interceptors?,def ...

  9. The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet- mapping*,session-config?,mime-map

    修改了一下web.xml,加入了一个<filter>,然后就报这样的错??? The content of element type "web-app" must ma ...

随机推荐

  1. tomcat加载java程序非常慢解决

    解决: 下面两种方式都要添加上,速度会很快,启动妙级的 1)在Tomcat环境中解决 可以通过配置JRE使用非阻塞的Entropy Source. 在catalina.sh中加入这么一行: JAVA_ ...

  2. pcntl_fork()函数说明

    pcntl_fork()函数复制了当前进程的PCB,并向父进程返回了派生子进程的pid,父子进程并行,打印语句的先后完全看系统的调度算法,打印的内容控制则靠pid变量来控制.因为我们知道pcntl_f ...

  3. XHProf报告字段含义

    Function Name:方法名称. Calls:方法被调用的次数. Calls%:方法调用次数在同级方法总数调用次数中所占的百分比. Incl.Wall Time(microsec):方法执行花费 ...

  4. 关于react中遇到的问题记录说明

    5.el表达式 dataSource = (userPage, orgList) => userPage.map(item => { const org = orgList.find(or ...

  5. SAP HANA2可视化客户端工具

    TreeSoft数据库管理系统使用JAVA开发,采用稳定通用的springMVC +JDBC架构,实现基于WEB方式对 MySQL,Oracle,PostgreSQL,MSSQL, Hive,DB2, ...

  6. Flutter之切换导航TabBar组件

    TabController 这是Tab页的控制器,用于定义Tab标签和内容页的坐标,还可配置标签页的切换动画效果等. TabController的创建有两种形式,一种是使用系统的DefaultTabC ...

  7. Java中处理OPC寄存器数据类型

    1. 在milo中,处理WORD等数据类型 例子如下: VariableNode node = client.getAddressSpace().createVariableNode( new Nod ...

  8. [Cometoj#4 B]奇偶性_打表

    奇偶性 题目链接:https://cometoj.com/contest/39/problem/B?problem_id=1577 数据范围:略. 题解: 因为$f$的构造原因,很容易找到规律. 进而 ...

  9. Python+requests重定向和追踪

    Python+requests重定向和追踪 一.什么是重定向 重定向就是网络请求被重新定个方向转到了其它位置 二.为什么要做重定向 网页重定向的情况一般有:网站调整(如网页目录结构变化).网页地址改变 ...

  10. 注意了,Mybatis中条件判断时遇到的坑

    1.mapper中比较字符串时需要注意的问题如下: mybatis 映射文件中,if标签判断字符串相等,两种方式:因为mybatis映射文件,是使用的ognl表达式,所以在判断字符串isComplet ...