Mapped Statements collection does not contain value for
来源:互联网 发布:ubuntu和centos的区别 编辑:程序博客网 时间:2024/06/07 06:20
Mapped Statements collection does not contain value for后面是什么类什么方法之类的:
错误原因有几种:
1、mapper.xml中没有加入namespace
2、mapper.xml中的方法和接口mapper的方法不对应
3、mapper.xml没有加入到mybatis-config.xml中(即总的配置文件),例外:配置了mapper文件的包路径的除外
错误原因有几种:
1、mapper.xml中没有加入namespace
2、mapper.xml中的方法和接口mapper的方法不对应
3、mapper.xml没有加入到mybatis-config.xml中(即总的配置文件),例外:配置了mapper文件的包路径的除外
4、mapper.xml文件名和所写的mapper名称不相同。
我遇到的问题是用maven管理mybatis项目。报Mapped Statements collection does not contain value for的错误,找了半天原因,发现部署后没有Mapper.xml文件,因为.xml文件在java目录中而不是resources目录下,所以没有被认为是资源文件而被部署。在pom.xml中配置一下
<sourceDirectory>src/main/java</sourceDirectory><testSourceDirectory>src/test/java</testSourceDirectory><resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> <resource> <!-- 配置需要被替换的资源文件路径 --> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource></resources>红色字体是针对本次问题起作用的地方。当然,最好都配置上。
0 0
- batis 错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for...
- Mapped Statements collection does not contain value for RelateMarketingMapper....解决办法
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for *
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for的解决方法
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for Addressbook.pageSelect
- Mapped Statements collection does not contain value for Addressbook.getByIds
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for xxxx
- spring整合redis客户端及缓存接口设计
- 南洋理工ACM 158省赛来了
- 设定servlet返回ajax值为json类型
- EventBus3.0的简单使用
- HDU 5558
- Mapped Statements collection does not contain value for
- opencv读取图片,灰化显示
- opengl es for android 中英文入门教程
- [F][5]bzoj 2724: [Violet 6]蒲公英
- HDU 5929 Basic Data Structure (模拟)
- 用git将项目代码上传到github
- 产生冠军 set容器使用
- cross-platform linux and windows
- Xcode8编辑代码崩溃解决办法