MyBatis 遇到的报错

1:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.myspringboot.dao.AyUserDao.findByNameAndPassword

这是因为namespace的问题  一定要写正确的路径名,当然了 ,也不能写错了 

2:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Error instantiating interface com.example.myspringboot.dao.AyUserDao with invalid types () or values (). Cause: java.lang.NoSuchMethodException: com.example.myspringboot.dao.AyUserDao.<init>()

这是因为 resultMap的type属性一定要写成你的实体类名  不要写成接口名  

错误实例:

正确的:

原文地址:https://www.cnblogs.com/yang1314/p/9327896.html