mybatis 配置中遇到的坑
来源:互联网 发布:围棋吃子软件 编辑:程序博客网 时间:2024/06/05 17:18
1、在配置时间时不能用*号,如<property name="maxXX" value="60*1000"/>,这样报错,需要将*去掉;
2、在配置xml文件时,resultMap一直包com.XXX.XXX类不能解析,一看原来是多一个空格;
3、found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency;
解决方法:(真是日了狗了)
在自动扫描配置时,将base-package配错
<!-- 排除controller,因为在spring-mvc.xml中已经扫描controller注解 -->
<context:component-scan base-package="com.project">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
4、严重: testWhileIdle is true, validationQuery not set,待解决:
5、报错:
严重: Servlet.service() for servlet [springmvc] in context with path [/ProjectCommon] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property '' of 'class com.project.modules.admin.dao.entity.SysUser' with value '100105' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named '' in 'class com.project.modules.admin.dao.entity.SysUser'] with root cause
org.apache.ibatis.reflection.ReflectionException: There is no setter for property named '' in 'class com.project.modules.admin.dao.entity.SysUser'
at org.apache.ibatis.reflection.Reflector.getSetInvoker(Reflector.java:372)
at org.apache.ibatis.reflection.MetaClass.getSetInvoker(MetaClass.java:174)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:167)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.set(BeanWrapper.java:57)
at org.apache.ibatis.reflection.MetaObject.setValue(MetaObject.java:133)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:368)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:338)
解决办法,奶奶的,要不是手写,也不会在mapper.xml 文件中resultMap标签中的property属性漏写,所以mapper.xml 中的属性要与实体类中一一对应,并提供geter和seter。
- mybatis 配置中遇到的坑
- mybatis 配置中遇到的坑之二
- 在配置springmvc整合MyBatis中遇到的各种问题
- mybatis中遇到的问题--mybatis.xml
- 配置MyBatis的整合遇到的问题
- SpringBoot配置MyBatis遇到的问题
- 最近遇到关于mybatis中#与$的一个坑
- mybatis遇到的那些坑
- 在mybatis中遇到奇怪的问题
- mybatis开发过程中遇到的问题
- mybatis sqlmap中property遇到的问题
- MyBatis中遇到的一些问题
- Mybatis学习中遇到的异常(1)
- Mybatis学习中遇到的异常(2)
- Mybatis学习中遇到的异常(3)
- 使用MyBatis过程中遇到的问题
- MyBatis中遇到的一些问题
- 关于mybatis中遇到的<foreach> 问题
- linux ubuntu 软件安装
- jenkins 实现PHP持续集成部署
- 深入解析HashMap、HashTable
- 财富论坛交通保障移动端项目记录
- 实现一个实体类的序列化和反序列化
- mybatis 配置中遇到的坑
- js实现点击div隐藏相应部分,再次点击显示
- 禅道远程连接数据库错误
- HDU 1841Find the Shortest Common Superstring
- SQLite学习手册(数据库和事务)
- ubuntu安装yii2.0
- python-numpy的基本用法02
- 一个前端项目,到底要集成多少库和工具
- 精仿今日头条