springboot整合mybatis报错invalid bound statement not found com dao deptdao findall

  • A+
所属分类:- mybatis

---
title: "SpringBoot整合mybatis报错Invalid bound statement (not found): com.dao.DeptDao.findAll"
date: 2019-04-15 15:44:33
categories:
- mybatis
- SpringBoot
tags:
- spring
- application
- mapper
- yml
- invalid
- mybaits
- 整合
- bound
- statement
- target
- mapper-locations
---

这个报错花了我很长时间,网上的办法我都试了也没用,感觉自己各个地方也都没有问题。target文件夹里mapper.xml也都生成了。最后在源码里debug发现,好像mapper.xml里的内容都没读进去,感觉还是配置的问题。

结果仔细检查了很久才发现是application.yml里mybatis:这里mybatis单词拼错了,导致下面的mapper-locations设置都没有读进去。。

无语。。

ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: