org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU
生活随笔
收集整理的這篇文章主要介紹了
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectUserByUname
解決思路:
1、先看注解是否都被掃描了 看mybatis-config 核心配置文件 是不是把mapper.xml的 映射路徑寫對(duì)拉。
2、看生成的target文件中 是否有 *mapper.xml 文件 maven 可能不會(huì)編譯 *mapper.xml文件
可以在pom.xml 中的build 加入下列代碼
<build><resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes><filtering>true</filtering></resource></resources> </build>3、*mapper.java 文件和 *mapper.xml 文件是否同名 不同名字改成同樣的名字
自言自語(yǔ)
慢慢修改bug 發(fā)現(xiàn)這些配置并不難,而是需要耐心去注意一些細(xì)節(jié)的處理。
總結(jié)
以上是生活随笔為你收集整理的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: JavaWeb 入门篇(2)Hello
- 下一篇: JavaWeb 入门篇(3)Servle