mybatis配置時出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
轉載自:https://www.cnblogs.com/lfm601508022/p/InvalidBoundStatement.html
如果出現:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
一般的原因是Mapper interface和xml檔案的定義對應不上,需要檢查包名,namespace,函式名稱等能否對應上,需要比較細緻的對比,我經常就是寫錯了一兩個字母搞的很長時間找不到錯誤
按以下步驟一一執行:
1:檢查xml檔案所在的package名稱是否和interface對應的package名稱一一對應
2:檢查xml檔案的namespace是否和xml檔案的package名稱一一對應
3:檢查函式名稱能否對應上
4:去掉xml檔案中的中文註釋
5:隨意在xml檔案中加一個空格或者空行然後儲存
一般來說到此就可以排除錯誤了
以上是轉載自http://blog.csdn.net/softwarehe/article/details/8889206
很自卑,這個方法困擾了5個小時,在這裡我已經翻遍了有關這個問題的搜素引擎,都沒解決,直到我看到上面那個轉載,我出現這個問題上面的方法都沒有解決,不過給了這些解決辦法給了我一個思路,就是xml編譯的問題,去看了編譯的檔案
編譯前
編譯後
果然沒有編譯進來。
解決方法有兩種:
1、把*Mapper.xml檔案放到resource資料夾下管理
2、pom配置一下編譯xml檔案
<resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource>
兩個方法都可以解決。
以上部分為轉載的。
本人採用的方法是,將xml檔案放到resources下面:
在配置檔案裡面加上mapperLocations:
相關文章
- mybatis3:Invalid bound statement (not found)MyBatisS3
- MyBatis 錯誤:Invalid bound statement (not found)MyBatis
- mybatis 報錯: Invalid bound statement (not found)MyBatis
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)ApacheBATException
- MyBatis繫結錯誤:org.apache.ibatis.binding.BindingException:Invalid bound statement (not found)MyBatisApacheException
- Invalid bound statement (not found)錯誤解決
- mybatis-plus自定義mapper報org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)MyBatisAPPApacheException
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): yycg.business.dao.mApacheBATException
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的問題處理方式之一ApacheBATException
- IDEA+Maven:invalid bound statement (not found)解決辦法IdeaMaven
- 【spring boot Mybatis】報錯:org.apache.ibatis.binding.BindingException: Invalid bound statement (not fo...Spring BootMyBatisApacheException
- MybatisPlus自帶方法報錯BindingException: Invalid bound statement (not found)MyBatisException
- 關於org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),找不到mapper檔案問題解決ApacheBATExceptionAPP
- IDEA+Maven+Springboot:invalid bound statement (not found) 解決辦法IdeaMavenSpring Boot
- 報錯Invalid bound statement (not found): com.thxy.mapper.RoleMapper.insertRleAPP
- 解決org.apache.ibatis.binding.BindingException: Invalid boundApacheBATException
- (已解決)確定mapper配置無誤,且配置檔案無誤, 執行無誤 出現org.apache.ibatis.binding.BindingException: Invalid bound statemenAPPApacheBATException
- 執行mysqlbinlog出現Found invalid event in binary log錯MySql
- (一)Mybatis基本配置,Statement方式,動態代理增刪改查MyBatis
- NetBeans 啟動時出現 Invalid jdkhome specified提示BeanJDK
- 深入淺出MyBatis:MyBatis的所有配置MyBatis
- SpringBoot整合mybatis出現時區問題Spring BootMyBatis
- mybatis竟然報"Invalid value for getInt()"MyBatis
- 關於merge時,出現的ORA-00904 invalid identifierIDE
- ios編譯ASIHTTPRequest時出現 'libxml/HTMLparser.h' file not found in ASIHTTPRequestiOS編譯HTTPXMLHTML
- org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found.ApacheBATException
- An invalid XML character (Unicode: 0x18) was foundXMLUnicode
- mybatis配置執行報出Caused by: org.apache.ibatis.binding.BindingException:相關錯誤解決或者空指標異常MyBatisApacheException指標
- Caused by: org.apache.ibatis.binding.BindingException: Parameter 'parameter' not found.解決ApacheBATException
- unity GPU bound or CPU boundUnityGPU
- 安裝CenOS出現“The CenOS disc was not found in any of ....”
- DBCA建庫出現CHMOD NOT FOUND錯誤
- RAC安裝時出現PRKC-1024 : Invalid netmask: eth0
- Mybatis實現條件IN查詢(foreach)和invalid comparison異常MyBatis
- Django出現DisallowedHost at / Invalid HTTP_HOST headerDjangoHTTPHeader
- QtCreator下執行opencv出現realloc():pointer invalidQTOpenCV
- 執行hadoop fs -ls時出現錯誤RuntimeException: core-site.xml not foundHadoopExceptionXML
- MyBatis 配置MyBatis