Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
来源:互联网 发布:linux卸载软件包 编辑:程序博客网 时间:2024/06/04 19:17
报错如下:
- ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.xxx.entity.UserMapper.insert
- ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.xxx.entity.UserMapper.insert
- at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
- at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
- at com.sun.proxy.$Proxy10.insert(Unknown Source)
- at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240)
可能的原因是:mapperLocations的value值classpath缺少了*号
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <!-- 自动扫描entity目录, 省掉Configuration.xml里的手工配置 -->
- <property name="mapperLocations" value="classpath:com/xxx/*/mapper/*.xml" />
- </bean>
修改如下:
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <!-- 自动扫描entity目录, 省掉Configuration.xml里的手工配置 -->
- <property name="mapperLocations" value="classpath*:com/xxx/*/mapper/*.xml" />
- </bean>
阅读全文
0 0
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
- 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 com.inter.IOperation.getAllItems
- Mybatis报错—— Mapped Statements collection does not contain value for com.mapper.DepartmentMapper
- spring,mbatis整合报错:Mapped Statements collection does not contain
- 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 xxx
- mybatis 错误之 Mapped Statements collection does not contain value
- mybatis错误 Mapped Statements collection does not contain value for
- 使用Maven构建项目,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...错误原因分析
- Mapped Statements collection does not contain value
- mybatis+springMVC整合出现Mapped Statements collection does not contain value for ***
- svn 命令
- 在编译项目的时候出现:Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.
- 机器学习中的特征选择
- 嵌入式linux QT环境搭建配置命令
- web.xml 配置
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
- 程序构建原理
- Ubuntu下MySQL的安装及远程连接配置等配置
- priority_queue优先级队列
- 树上差分的两种基本操作
- 基于R的数据挖掘方法与实践(2)——关联规则
- [Python]常用技巧之CSV处理
- 关于多指针指向同一块内存的问题!
- FTP默认模式搭建