Attribute "resource" must be declared for element type "mapper".
来源:互联网 发布:软件工程硕士院校排名 编辑:程序博客网 时间:2024/05/16 10:31
Mybatis项目配置别名时配置文件遇到的问题
遇到如下问题:Attribute "resource" must be declared for element type "mapper".
解决方案:mybatis 的dtd 文件配置有误
正确的应该是:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <typeAliases> <typeAlias type="com.entity.User" alias="user"/> </typeAliases> <!-- 映射文件,存放sql语句的配置文件 --> <mappers><mapper resource="com/mybatis/demo/mapper/UserDao.xml" /></mappers> </configuration>
应该是configuration
这样写之后就不会再报之前那个错误了
0 0
- Attribute "resource" must be declared for element type "mapper".
- FAQ(4):Attribute "resource" must be declared for element type "mapper".
- Attribute "nameSpace" must be declared for element type "sqlMap".
- Attribute "scope" must be declared for element type "bean"
- Attribute "column" must be declared for element type "property"解决办法
- Attribute "scope" must be declared for element type "bean"-[spring]
- Attribute "column" must be declared for element type "property"解决办法
- Attribute "resultClass" must be declared for element type "insert".
- Attribute "statementType" must be declared for element type "procedure"
- 1.Attribute "table" must be declared for element type "subclass".
- Attribute "scope" must be declared for element type "bean"
- Attribute "resultCalss" must be declared for element type "select".
- Attribute "scope" must be declared for element type "bean"
- Attribute "column" must be declared for element type "property"解决办法
- 【hibernate】Attribute "column" must be declared for element type "property"解决办法
- org.xml.sax.SAXParseException: Attribute "colum" must be declared for element type "result".
- Caused by: org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for element type "beans
- Attribute "resultType" must be declared for element type "update" or "insert"
- 智能手机怎样才能不会被定位追踪?
- Identity service-ERROR
- 【HDU】 1719 Friend
- Java解释器模式
- 链表面试题之快慢指针问题(一) 查找链表中间节点
- Attribute "resource" must be declared for element type "mapper".
- NN & SN & DN
- LeetCode Partition List(链表分段)
- JavaCompiler
- ES是如何实现节点容灾的
- Java 集合类详解
- Android Studio混淆方法
- C++和双重检查锁定模式(DCLP)的风险
- android2.3.4----4.hal与framebuffer的交互