mybatis异常
来源:互联网 发布:绘图软件spaceman 编辑:程序博客网 时间:2024/06/05 01:57
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): me.tspace.pm.dao.UserDao.getUser
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:178)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
at $Proxy22.getUser(Unknown Source)
........................
........................
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for me.tspace.pm.dao.UserDao.getUser
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:615)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:608)
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:176)
... 34 more
两种情况:
1.
<mapper namespace="me.tspace.pm.dao.UserDao">
mapper的namespace写的不对!!!注意系修改。
2.
UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此错。
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [springMVC.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [springMVC.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatisConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for me.tspace.pm.dao.UserDao.getUser
mybatis的貌似mapper不允许重载.......
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)".
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:79)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:63)
at man.send.TestPushEmail.testMybatis(TestPushEmail.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
节点顺序需要按照提示放置!
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
org.apache.ibatis.binding.BindingException: Type interface main.send.dao.SearchRecordDao is not known to the MapperRegistry.
at org.apache.ibatis.binding.MapperRegistry.getMapper(MapperRegistry.java:42)
at org.apache.ibatis.session.Configuration.getMapper(Configuration.java:639)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:218)
at main.send.service.impl.SearchRecordServiceImpl.getRandomId(SearchRecordServiceImpl.java:17)
at man.send.TestPushEmail.SearchRecordService(TestPushEmail.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
- <mapper namespace="Mapper.UserMapper">
- <!-- 这里namespace必须是UserMapper接口的路径,不然要运行的时候要报错 “is not known to the MapperRegistry”-->
- mybatis异常
- mybatis异常
- mybatis异常
- mybatis异常
- mybatis异常
- mybatis异常
- mybatis异常
- Spring3 Mybatis 异常处理
- mybatis捕捉异常
- Spring3 Mybatis 异常处理
- oracle/Mybatis异常处理
- Mybatis 使用异常总结
- MyBatis--autowire异常情况
- mybatis generator StringIndexOutOfBoundsException异常
- mybatis 异常信息记录
- mybatis mapper 异常
- SpringBoot Mybatis注入异常
- mybatis异常01
- oracle11g从11.2.0.3.0升级到11.2.0.3.6操作步骤(二)
- 根文件系统及Busybox简介
- Sql语句查询精选
- Iphone 开发环境
- 3D相册(3D + 倒影效果)源代码
- mybatis异常
- linux ,Android基础知识总结
- Android --- 斗地主 [牌桌实现源码] !!!!!!!!!!!!!!!!!!
- Extjs PagingToolbar下拉框分页插件 Ext.ux.ComboPageSize
- JQuery插件第三十五个:在指定范围内水平垂直居中浮动层
- android thread实例
- Android设备驱动之——V4L2
- java 大数据处理
- 获取当前显示的activity