Springboot-001-解决nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]
环境:Springboot + Mybatis + MySQL + VUE
场景:
前端发出数据比对请求,在服务后台与数据库交互时,接口提示错误信息如下所示:
{
"code": 999,
"success": false,
"msg": "nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]",
"menu": "DATABASE",
"action": "DATABASE_COMPARE",
"operator": "ANON",
"datetime": "2018-10-23 11:26:17.877"
}
控制台日志响应如下所示:

解决:
由错误信息可知,Mybatis在操作数据库前未接收到请求参数,实际为Respository/Mapper中的SQL语句中引用的参数未获取到所导致的报错信息。查看源码可知,如下代码中蓝色加粗部分缺失导致的,添加后,问题解决。
@Select("select * from `data` " +
"where eng = #{eng} and env like '%${env}%' ")
@Results({
@Result(property = "id", column = "id"),
@Result(property = "env", column = "env"),
@Result(property = "eng", column = "eng"),
})
List<Database> findAllComp(@Param("eng") String eng, @Param("env") String env);
Springboot-001-解决nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]的更多相关文章
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [arg1, arg0, param1, param2]
2018-06-27 16:43:45.552 INFO 16932 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]
Spring+mybatis错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi ...
- SpringBoot整合Mybatis注解版---update出现org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0, param1, param2]
SpringBoot整合Mybatis注解版---update时出现的问题 问题描述: 1.sql建表语句 DROP TABLE IF EXISTS `department`; CREATE TABL ...
- ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]
org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ib ...
- org.apache.ibatis.binding.BindingException: Parameter '0' not found. Available parameters are [arg1, arg0, param1, param2]
报错信息如下: org.apache.ibatis.binding.BindingException: Parameter '0' not found. Available parameters ar ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'employeeId' not found. Available parameters are [page, map, param1, param2] 解决方法
原因很简单就是没映射到接口添加 @Param 注解 ->@Param("map") 然后在mapper.xml map.employeeId 再次测试 已经解决 ->
- Mybatis报错 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'parentCode' not found. Available parameters are [0, 1, param1, param2]
orcal数据库使用mybatis接收参数,如果传的是多个参数,需要使用#{0},#{1},...等代替具体参数名,0 代表第一个参数,1 代表第二个参数,以此类推. 错误语句: <select ...
- org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2]
这个异常说明参数没有加上@Param注解,加上这个注解就行了. 默认情况下mybatis把参数按顺序转化为[0, 1, param1, param2],也就是说#{0} 和 #{param1} 是一样 ...
- 怪事年年有,今天特别多!org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'empno' not found. Available parameters are [emp, deptno, param1, param
错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Binding ...
随机推荐
- numpy数据去重
import numpy as npx = np.array([1,2,3,2,4,2,5,7,7])print(np.unique(x)) 简单散点图的绘制,没有显示出文字是因为需要下载个插件
- vs2010编译error_code
C1083 : 现象: xxxxx.cpp clxx:fatal error C1083:无法打开源文件: “..\..\..\..\src\folder1\folder2\folder3\folde ...
- C# 在遍历中修改或者移除元素
; i >= ; i--) { var l = imgList[i].Trim(); if (!l.ToLower().Contains(".jpg") && ...
- Python目录:
Python基础 python书写规范--消去提示波浪线 Python 列表(list) Python字符串 Python字典 Python文件操作 Python函数 Python函数-装饰器 Pyt ...
- leetcode目录
Leetcode 1. 数组 2. 动态规划 3. 字符串 4. 链表.双指针.排序 5. 树 6. 回溯算法.贪心算法.分治算法.
- Actor消息发送及等待结果关键字
class Task extends Actor{ override def act(): Unit = { while(true){ receive({ case SmTask(file) => ...
- spring Boot异步操作报错误: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.self.spring.springboot.Jeep' available
我也是最近开始学习Spring Boot,在执行异步操作的时候总是汇报如下的错误: Exception in thread "main" org.springframework.b ...
- Linux安装Tomcat-Nginx-FastDFS-Redis-Solr-集群——【第九集-补充-之安装iptables】
1,安装完了jdk,tomcat,启动tomcat的bin/startup.sh后,发现在浏览器输入公网ip地址和tomcat的默认(server.xml)中的端口port:8080,无法访问,这主要 ...
- nginx 配置laravel框架域名配置
server { listen 80; server_name admin.meiquick.local.com; #charset koi8-r; # access_log /var/log/ngi ...
- mongodb 遇到问题-查询单个需要包装id
mongodb,get字符查询需要传入特定的包装id才能识别 const ObjectID = require('mongodb').ObjectID exports.queryOne = (req, ...