今天在玩mybatis的时候,遇到这个奇葩问题。

最后发现,原因是 dtd文件配置错误了。错把Mapper的直接copy过来

把DOCTYPE mapper改成configuration,Mapper改成config即可

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<configuration> <typeAliases>
<typeAlias alias="Jit" type="springmvcexample.demo.model.Jit"/>
</typeAliases> <!-- 注册对象的空间命名 -->
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://10.199.160.35:3306/vop_data_stg"/>
<property name="username" value="root"/>
<property name="password" value="test"/>
</dataSource>
</environment>
</environments> <mappers>
<mapper resource="jitMapper.xml" />
</mappers>
</configuration>

Attribute "resource" must be declared for element type "mapper".的更多相关文章

  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. Attribute "resultType" must be declared for element type "insert"或"update"

    Attribute "resultType" must be declared for element type "insert"或"update&q ...

  3. Attribute "not-null" must be declared for element type "property"解决办法

    Attribute "not-null" must be declared for element type "property"解决办法 在hiberante ...

  4. Attribute "resultType" must be declared for element type "insert".

    这是mybatis插入数据库之后出现的问题,至于为什么出现这个问题,是因为插入的时候你照抄了查询的语句,插入的时候只有id属性和parameterType属性,并没有“resultType”属性,要注 ...

  5. Attribute "resultType" must be declared for element type "update" or "insert"

    仔细查看错误如图所示: 解决错误就是把resultType去掉,因为在insert和update语句中是没有返回值的.小坑小坑 转自:https://blog.csdn.net/u013144287/ ...

  6. Attribute name "aphmodel" associated with an element type "mxg" must be followed by the ' = ' charac

    1.错误描述 org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: Attribute name &quo ...

  7. namespace" 或The content of element type "mapper" must match "EMPTY"

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

  8. Open quote is expected for attribute "property" associated with an element type "result".错误

    java  Mybatis 框架下的项目 报   Open quote is expected for attribute "property" associated with a ...

  9. [Fatal Error] :3:13: Open quote is expected for attribute "{1}" associated with an element type "id".

    用DOM解析XML时出现了如下错误: [Fatal Error] :3:13: Open quote is expected for attribute "{1}" associa ...

随机推荐

  1. reverse-daily(1)-audio_visual_receiver_code

    本人第一篇随笔,就以一篇CTF逆向分析的文章开始吧! 链接:http://pan.baidu.com/s/1eS6xFIa 密码:u14d 因为re的分析比较琐碎,所以主要就挑一些重点东西来说. 据说 ...

  2. swiper的使用

    最近要用html5制作可以一屏一屏向上滑动的页面,发现大家使用swiper插件的较多,所以试了试,发现做出来的效果还不错,喜欢的朋友可以参考一下自己动手做啦. 1.首先我们要引入4个文件: <h ...

  3. Nagios NSclient Failed to get CPU value: \238(_total)\6: Failed to get mutex :(

    一台Windows Server 2012的nsclient出现以下的错误,表示无法获得CPU信息 2016-08-08 10:31:33: e:..\..\..\..\trunk\modules\C ...

  4. iTunesConnect进行App转移2-官方说明

    Can I transfer an app to another developer's iTunes Connect account? Yes, you can transfer your app ...

  5. JAVA修饰符类型(public,protected,private,friendly)

    转自:http://www.cnblogs.com/webapplee/p/3771708.html JAVA修饰符类型(public,protected,private,friendly) publ ...

  6. null、空对象和undefined

    null:是对象,但是空引用(不指向任何对象) 空对象:是对象,但它的值是指向没有任何属性的对象的引用 undefined:未定义,所以不是对象,本身被定义为“undefined”这一特殊类型 1. ...

  7. LeetCode() Ugly Number II 背下来!

    一个别人,非常牛逼的思路,膜拜了!orz!!!! vector <int> results (1,1); int i = 0, j = 0, k = 0; while (results.s ...

  8. [hdu 4307]Matrix

    真是一道很好的题目喵~ 一看题面真是无语了……很直接.很暴力.很恶心.说实话,除了 straight forward 我脑子里就没想过别的 上网看了一下居然是最小割,脑子里面一下子就清醒了,N< ...

  9. maxscript, 批量导出物体

    1,将场景中所有选中物体整体导出为一个fbx文件 exportfile filename #noprompt selectedOnly:true using:FBXEXP 2,将场景中所有选中物体各导 ...

  10. wdcp的安装扩展模块

    其实就是官方包里面的所有附加模块全部支持啦.~~是在官方的基础上修改的优化了每次都解压缩php源码包,按需解压缩使用方法如下wget http://git.oschina.net/loblog/mem ...