mybatis bug之org.apache.ibatis.exceptions.PersistenceException:
详细报错信息:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.IllegalArgumentException: findAllList is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)
### Cause: java.lang.IllegalArgumentException: findAllList is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries) at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
at com.ahd.Test.test.test(test.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.IllegalArgumentException: findAllList is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:800)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:631)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:624)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
... 25 more
解决总结:
findAllList is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)
findAllList在映射语句集合中是不明确的(尝试使用包含名称空间的全名,或者重命名其中一个条目)
- Persistence Exception 持久化 异常
- 持久化异常这种bug一般都是xml文件配置有错误,
- 测试时:主配置文件使用包名找xml文件,直接写映射文件名称没有问题,通过包扫描有问题
<!--第一种:写映射文件的名字-->
<!--
<mapper resource="com/ahd/mapper/UserMapper.xml"></mapper>
-->
<!--第二种:写类名,一定要有个映射文件与之对应
如果没有,那么在UserMapper要声明注解-->
<!--<mapper class="com.gyf.mapper.UserMapper"></mapper>--> <!--第三种:可以写包名-->
<package name="com.ahd.mapper"></package>
4. *****(方法名) is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)
本次错误是因为系统找不到findAllList对应的映射
5.查看发现多个***mapper.xml都有这个方法,系统不知道使用的是哪一个,将findAllList方法加上路径即可
mybatis bug之org.apache.ibatis.exceptions.PersistenceException:的更多相关文章
- Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException
在映射文件中,通过parameterType指定输入参数的类型,类型可以是简单类型.hashmap.pojo的包装类型.在测试包装类型过程中产生了一个错误:org.apache.ibatis.exce ...
- HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e ...
- mybatis <fireach> 拼接sql语句 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'in'. Cause:
<select id="getUserIn" parameterType="QueryVo" resultMap="userMap"& ...
- MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException
错误信息如下: HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache. ...
- MyException--org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ###
org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may ...
- org.apache.ibatis.exceptions.PersistenceException:
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.Ill ...
- org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.NumberFormatException: For input string: "W%" ### Cause: java.lang.NumberFormatException: For input s
一个常见的myBatis xml文件中的引号错误: org.apache.ibatis.exceptions.PersistenceException: ### Error querying data ...
- org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manu
这个是sql 语句 错误 仔细检查 SQL语句是否写错了 org.apache.ibatis.exceptions.PersistenceException: ### Error queryi ...
- org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent succ
数据库 没有开启 连接失败 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause ...
随机推荐
- 【SAP业务模式】之STO(一):业务背景和前台操作
所谓STO即两个关联公司之间的库存转储交易,一家公司发出采购订单向另一家公司做采购,然后在做发货.如此之后,两家公司有相应应收应付的票据,以及开票和发票校验等动作. STO分为一步法与两步法,因为一步 ...
- Javapoet源码解析
Javapoet:是生成.java源文件的开源API github:https://github.com/square/javapoet 以生成一个HelloWrold.java文件为例: pa ...
- RabbitMQ的介绍及使用进阶(Docker+.Net Core)
目录: 一.什么是RabbitMQ 二.RabbitMQ运用场景 三.RabbitMQ优势及特点 四.Centos7中Docker安装RabbitMQ 五..Net Core 中使用RabbitMQ ...
- 关于 JavaScript 中的继承
ES5 之前,继续是这样实现的 function Parent() { this.foo = function() { console.log('foo'); }; } Parent.prototyp ...
- java数据结构和算法02(栈)
什么叫做栈(Stack)呢?这里的栈和jvm的java栈可不是一个东西... 栈作为一种数据结构,我感觉栈就类似一种接口,实现的话有很多种,比如用数组.集合.链表都可以实现栈的功能,栈最大的特点就是先 ...
- 深度学习之卷积神经网络(CNN)的应用-验证码的生成与识别
验证码的生成与识别 本文系作者原创,转载请注明出处:https://www.cnblogs.com/further-further-further/p/10755361.html 目录 1.验证码的制 ...
- Redis客户端——Jedis的使用
本文介绍基于Java语言的Redis客户端——Jedis的使用,包括Jedis简介.获取Jedis.Jedis直连.Jedis连接池以及二者的对比的选择. Jedis简介 Jedis 是 Redis ...
- 【响应式编程的思维艺术】 (5)Angular中Rxjs的应用示例
目录 一. 划重点 二. Angular应用中的Http请求 三. 使用Rxjs构建Http请求结果的处理管道 3.1 基本示例 3.2 常见的操作符 四. 冷热Observable的两种典型场景 4 ...
- CODING Pages 服务全面升级,更快更稳更可靠!
尊敬的 CODING 用户: 您好! 由于原上游服务商无法满足 CODING Pages 日益增长的用户量以及访问速度需求,同时提供的 DDoS 解决方案无法支撑大型 DDoS 攻击,给 CODING ...
- SqlServer 递归查询
--查询部门及下属部门列表 WITH TEMP --递归 AS (SELECT Id, Code, Name, ParentId FROM [dbo].[AspSysDepartments] --查询 ...