Attribute "resource" must be declared for element type "mapper".
今天在玩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".的更多相关文章
- 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 ...
- Attribute "resultType" must be declared for element type "insert"或"update"
Attribute "resultType" must be declared for element type "insert"或"update&q ...
- Attribute "not-null" must be declared for element type "property"解决办法
Attribute "not-null" must be declared for element type "property"解决办法 在hiberante ...
- Attribute "resultType" must be declared for element type "insert".
这是mybatis插入数据库之后出现的问题,至于为什么出现这个问题,是因为插入的时候你照抄了查询的语句,插入的时候只有id属性和parameterType属性,并没有“resultType”属性,要注 ...
- Attribute "resultType" must be declared for element type "update" or "insert"
仔细查看错误如图所示: 解决错误就是把resultType去掉,因为在insert和update语句中是没有返回值的.小坑小坑 转自:https://blog.csdn.net/u013144287/ ...
- 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 ...
- namespace" 或The content of element type "mapper" must match "EMPTY"
必须为元素类型 "mapper" 声明属性 "namespace" 或The content of element type "mapper" ...
- 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 ...
- [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 ...
随机推荐
- php7+apache2.4 (Windows7下),成功启动。(楼主另外提供了1个php7集成环境打包: http://pan.baidu.com/s/1qXwjpF2 ,如果你只是想了解一下,放在d盘根目录。)
php7正式版已经发布,性能是php5.4的2倍.博主入手php7 新鲜了一把,下面是解决问题之后成功启动php7的记录. ( 电脑必须win7 sp1, .netframework4 ) Windo ...
- SQL 金额千分位显示
第一种:select convert(varchar,cast(_money AS MONEY),1) AS _money -----带小数点的第二种: select reverse(stuff(re ...
- CodeBlocks 中fopen函数不支持命令 “r”
//codeblocks #include<stdio.h> #include<stdlib.h> void main(void) { FILE *fp=NULL; if((f ...
- unity之mipmap
Mipmap技术有点类似于LOD技术,但是不同的是,LOD针对的是模型资源,而Mipmap针对的纹理贴图资源 使用Mipmap后,贴图会根据摄像机距离的远近,选择使用不同精度的贴图. 缺点:会占用内存 ...
- 根据 url请求数据
public static JSONObject getJsonFromUrl(String url){ CloseableHttpClient httpClient = HttpClients.cr ...
- Qt学习1
Action 的用法 首先在头文件的 private 中加: 1 2 3 QMenu *fileMenu; QMenu *editMenu; QMenu *helpMenu; 1 2 3 4 5 6 ...
- python request属性及方法说明
if request.REQUEST.has_key('键值'): HttpRequest对象的属性 参考: 表 H-1. HttpRequest对象的属性 属 性 描述 path 表示提 ...
- testNG设置测试的执行顺序
在java类中,设置Test的执行顺序可以使用priority,或者enabled等属性.但是在testng.xml中,需要设置它的 preserve-order="true" 另 ...
- SQL总结(七)查询实战
SQL总结(七)查询实战 一.场景 给定一个场景,学生选课系统为例,大家很熟悉. 主要关系: 学生(学号.姓名.年龄.性别) 教师(教师ID,教师姓名) 课程(课程ID,课程名称,任教教师ID) 成绩 ...
- Qt StyleSheet样式表实例(转)
QT论坛看到的,收藏一下! 在涉及到Qt 美工的时候首先需要掌握CSS 级联样式表. 下面将通过几个例子来介绍一下怎样使用Qt中的部件类型设计.自定义的前台背景与后台背景的颜色: 如果需要一个文本编辑 ...