0%

Exception-Mybatis-BindingException

Mybatis的BindingException异常解决

Mybatis-BindingException

来自 :https://blog.csdn.net/weixin_42230885/article/details/84855041

本地idea运行可以,服务器端jar包部署运行错误。

报错:

1
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'id' not found. Available parameters are [arg1, arg0, param1, param2]

注解SQL错误写法:

1
int insertObject(Integer userId,Integer[] roleIds);

注解SQL正确写法:

1
int insertObject(@Param("userId")Integer userId,@Param("roleIds")Integer[] roleIds);