MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException
错误信息如下:
HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: type Exception report message org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.RuntimeException: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.reflect.UndeclaredThrowableException
### The error may exist in class path resource [mybatis/mapper/SysTradeTradeMapper.xml]
### The error may involve com.zito.b2c.order.mapper.SysTradeTradeMapper.getOperatingSituation-Inline
### The error occurred while setting parameters
### Cause: java.lang.reflect.UndeclaredThrowableException
### Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
通过查看错误信息,可以发现"The error occurred while setting parameters",错误是参数传入的时候出的错。
Mapper接口方法如下:
public Map<String,String> queryOrder(@Param("shopId") int shopId, @Param("shopName") String shopName);
Mapper.xml中方法的配置:
<select id="queryOrder" parameterType="String" resultType="java.util.Map"> </select>
因为传入的参数既有Sting又有int,而我们在xml中配置的传入参数类型只有Sting,所以会报传入参数类型不匹配。
再由对个参数传入,并且传入参数的类型不一致时,可以去掉 parameterType
MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException的更多相关文章
- 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 bug之org.apache.ibatis.exceptions.PersistenceException:
详细报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java. ...
- 错误信息: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
这个错误主要原因是:数据库的配置出问题,比如写错库名什么的,仔细检查下.
- 使用Mybatis连接数据库时报错:org.apache.ibatis.exceptions.PersistenceException: ### Error updating database.
我的原因是字段名写错了,去数据库中复制字段名再运行就成功了.
- Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException
在映射文件中,通过parameterType指定输入参数的类型,类型可以是简单类型.hashmap.pojo的包装类型.在测试包装类型过程中产生了一个错误:org.apache.ibatis.exce ...
- 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"& ...
- 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: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents mor
今天在用junit测试mybits程序是遇到一个问题,报错为: org.apache.ibatis.exceptions.PersistenceException: ### Error queryin ...
- 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 ...
随机推荐
- 转载:移动web开发规范
本文来源:http://blog.csdn.net/joueu/article/details/44329825 以下是规范建议,均是日常在开发当中的的一些经验,仅供参考. 移动web开发规范 一.头 ...
- BestCoder#49
Untitled Accepts: 504 Submissions: 1542 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/6 ...
- winform下的简易播放器
编写这个播放器,遇到很多问题,比如目前只实现了wav音频文件的播放,而对于这个图中中间所标注的按钮 不能实现让其暂停的功能,同时当点击的时候,让其文本变为"▷",对于这部分功能不知 ...
- bzoj3123: [Sdoi2013]森林
题面传送门 复出的第一道题.. md就遇到坑了.. 简单来说就是可持久化线段树+启发式合并啊.. 感觉启发式合并好神奇好想学 每一次建边就暴力合并,每一个节点维护从根到它的权值线段树 按照题面的话最省 ...
- python基础06 循环
循环用于重复执行一些程序. for循环 for循环需要预先设定循环的次数n,然后执行隶属于for的语句. 基本构造是 for 元素 in 序列: statement 如: for a in [1 ...
- MacOS下Express安装过程中遇到的问题
问题描述: 使用nmp install express -g命令全局安装express后,在终端使用express -V命令可以获取到express的版本号,但在引用express的项目运行时,会报缺 ...
- Ubuntu 安装 JDK 7
直接下载jdk压缩包方式安装 分为下面5个步骤 1.官网下载JDK 2.解压缩,放到指定目录 3.配置环境变量 4.设置系统默认JDK 5. 测试jdk 1.官网下载JDK 地址: http ...
- java执行linux命令
package com.gtstar.collector; import java.io.BufferedReader;import java.io.IOException;import java.i ...
- MySQL字符集
字符集的选择 1.如果数据库只需要支持中文,数据量很大,性能要求也很高,应该选择双字节定长编码的中文字符集(如GBK).因为相对于UTF-8而言,GBK"较小",每个汉字只占2个字 ...
- dnslog注入
使用Powershell反弹Meterpreter Shell cloudeye在windows下的应用 今天突发奇想的一个姿势,算不上什么技巧,分享一下吧. 看到有人问过.http://zone.w ...