解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

意思是没有找到com.tuniu.dao.CategoryDao.findAll

这种情况,一般都是配置文件出了问题,配置映射不对.

看了一下SqlMapConfig.xml中的配置

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

我这边记录一下解决的办法

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

最后发现是单词写错了

CategoryDao的Dao接口

写成了

CategotyDao.xml的xml配置文件.

Dao接口与xml配置文件不对应,所以使用自动配置说找不到.

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

CategoryDao对应,则运行成功!!!

这里顺便说一下配置mapper映射的两种方法

第一种(单个配置)

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

但显然过于麻烦

第二种(扫包)推荐使用

解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.tuniu.dao.

相关文章:

  • 2021-12-14
  • 2022-12-23
  • 2021-12-25
  • 2021-07-08
  • 2021-04-19
  • 2021-05-03
  • 2022-01-09
猜你喜欢
  • 2022-02-04
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2021-11-15
  • 2021-12-16
相关资源
相似解决方案