spring boot 整合mybatis:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

最近在学习SpringBoot,遇到些异常情况:

1、异常信息

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hippo.demo.dao.Chapter6DemoMapper.insert

2、解决方案

问题找了很久,发现使用@Select、@Insert、@Update、@Delete注解代替xxxMapper.xml里面的内容,不存在异常,那就是扫描xxxMapper.xml文件的问题了,查询application.properties配置文件中发现

mybatis.mapper-locations的配置路径除了问题,如图:

修改路径后: mybatis.mapper-locations=classpath:com/hippo/demo/dao/*.xml,问题得到解决。



 

原文地址:https://www.cnblogs.com/echo33/p/9578176.html