使用Maven构建项目,spring整合mybatis发生错误:Mapped Statements collection does not contain value for
来源:互联网 发布:伊甸园 本站域名是什么 编辑:程序博客网 时间:2024/06/13 17:34
问题产生原因:这是因为在使用maven构建项目时,当启动maven的tomcat插件运行项目只会加载src/main/resources目录下的配置文件,并不会去加载放在src/main/java目录下的配置文件,这是导致产生错误:Mapped Statements collection does not contain value for 的根本原因。
解决方法:在配置文件所在的项目下的pom文件中添加以下配置,这样就会扫描到src/main/java目录下的配置文件
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --><build><resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources></build>
阅读全文
0 0
- 使用Maven构建项目,spring整合mybatis发生错误:Mapped Statements collection does not contain value for
- Spring整合MyBatis错误:Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- spring+mybatis项目搭建测试报错Mapped Statements collection does not contain value for
- MyBatis:Mapped Statements collection does not contain value for xxx
- mybatis 错误之 Mapped Statements collection does not contain value
- batis 错误 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错误
- mybaits错误:Mapped Statements collection does not contain value for **
- mybatis+springMVC整合出现Mapped Statements collection does not contain value for ***
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
- mybatis之Mapped Statements collection does not contain value for...错误原因分析
- mybatis错误java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- android布局之RelativeLayout
- GYM
- win32控制台停留--ctrl+f5
- Swift Core Data
- Android 线程管理之 CountDownLatch(闭锁)
- 使用Maven构建项目,spring整合mybatis发生错误:Mapped Statements collection does not contain value for
- Spring Bean InitializingBean和DisposableBean实例区别
- 原码, 反码, 补码 详解
- 多行多列RadioGroup
- git 关联远程仓库的问题
- js里面的枚举问题
- 【opencv】opencv编译生成sln的方法
- 动态规划的两种方式
- Android的monkey 基本参数