1. 程式人生 > >【錯誤處理】Mybatis繫結錯誤 Invalid bound statement (not found)

【錯誤處理】Mybatis繫結錯誤 Invalid bound statement (not found)

        隔了好久重新搭建SSM框架,出現了好多BUG,但排查,解決BUG的同時也讓我更加深入地瞭解到Tomcat SSM框架等技術的執行原理。

        【錯誤原因簡述】

                相信大家出現這個問題的時候都會很驚訝,自己的Dao層,Mapper都是自動生成的,怎麼可能錯呢?

            是的,Mybatis自動生成的程式碼確實沒出問題,往往是因為Tomcat在將工程打包的時候出錯了。

            往往是因為Tomcat在將工程打成war包執行時,漏了.xml檔案,或.properties檔案。

        【解決方法】

                在pom.xml檔案的<build>標籤內加入這段程式碼:

                強制掃描properties,xml檔案

        <resources>  
            <resource>  
                <directory>src/main/java</directory>  
                <includes>  
                    <include>**/*.properties</include>  
                    <include>**/*.xml</include>  
                </includes>  
                <filtering>false</filtering>  
            </resource>  
            <resource>  
                <directory>src/main/resources</directory>  
                <includes>  
                    <include>**/*.properties</include>  
                    <include>**/*.xml</include>  
                </includes>  
                <filtering>false</filtering>  
            </resource>  
        </resources>

            BUG的解決除了自己的探索還受到了其他優秀部落格的啟發。

            如果沒能幫你解決問題,可以參考這個部落格,寫得很詳細!希望能給你帶來幫助

            https://www.jianshu.com/p/800fe918cc7a

相關推薦

錯誤處理Mybatis錯誤 Invalid bound statement (not found)

        隔了好久重新搭建SSM框架,出現了好多BUG,但排查,解決BUG的同時也讓我更加深入地瞭解到Tomcat SSM框架等技術的執行原理。        【錯誤原因簡述】                相信大家出現這個問題的時候都會很驚訝,自己的Dao層,Mapp

mybatis多資料來源錯誤:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

使用Spring Boot2.0整合mybatis多資料來源遇到如下錯誤 錯誤資訊: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.boot.mapper.one.Sc

Springboot中mybatis報錯:Invalid bound statement (not found)

小場面不要驚慌,分5種情況,檢查你的配置和程式碼,看有沒有中招; xml檔案的select標籤的id對應dao檔案的方法名,兩者必須完全一致 xml檔案中的 namespace=“xxx.xxx.xxx.Mapper” 中的路徑是否與介面檔案路徑一致 xml檔案中的p

關於IDEA工具在springboot整合mybatis中出現的Invalid bound statement (not found)問題

第一次寫部落格。有點小激動。 筆者因為工作需要,所以需要學習springboot和springcloud,而開發工具則是公司要求使用的IDEA2017,筆者之前的開發工具是Myeclipse. 換了工具有諸多的不適應,還在慢慢的熟悉 在學習過程中難免有些磕磕碰碰,幾天下來碰

解決IDEA中springboot整合mybatis中出現的Invalid bound statement(not found)的問題

IDEA對xml檔案處理的方式不同,在Eclipse中到dao檔案與mapper.xml檔案只要在同一級目錄下即可,但是在IDEA中,mapper.xml要放在resources目錄下 所以針對myba

mybatis錯誤 Invalid bound statement (not found)

如果出現: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper interface和xml檔案的定義對應不上,需要檢查包名,namespace,函式名

mybitis錯誤Invalid bound statement (not found): com.bt.mapper.UserMapper.queryUserList

這個問題是:mybitis繫結錯誤,找不到queryUserList方法,這個問題找了好久,終於發現錯誤了。 首先:對於mybitis繫結錯誤,常用解決方法,其他地方都有寫,我這裡記錄的是我出錯的原因及解決方法。 我錯誤的原因是pom.xml檔案中少兩個包,如下圖所示:

spring boot Mybatis報錯:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add

使用 ase err abstract internal tin mic pre uestc 報錯如下: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): c

在使用mybatis的selectFromExample時出現Invalid bound statement (not found)錯誤

oca ror jdk filter tro lec ces hint nco 主要原因:運行項目在構建的時候只會默認的去加載resource資源文件裏面的資源,其他地方的配置資源不會加載 。故沒有讀取到mybatis的MapperXml映射 結構如下 =======

ideMyBatis報錯: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

align basedir schedule ima reflect oda apache ref mapper at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.j

myBatis的binding錯誤Invalid bound statement (not found)

per HERE state gui bean ESS dao 錯誤 java org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)錯誤這個問題我找了好久,終於找到了正

IDEA中Mybatis傳統配置映射文件的時候遇到org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): mapper.UserMapper.getUserById錯誤

apache image 傳統 .com ima app .get 映射 bin 我不知道是IDEA機制的問題還是咋回事 不會自動加載到這個文件裏來 沒搞太明白 IDEA中Mybatis傳統配置映射文件的時候遇到org.apache.ibatis.bind

[MyBatis]詭異的Invalid bound statement (not found)錯誤

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

分散式系統架構關於Invalid bound statement (not found)的錯誤處理

分散式系統架構關於Invalid bound statement (not found)的錯誤處理,錯誤資訊如下: 該錯誤是一個典型的沒有找到*mapper.xml檔案的錯誤,由於在分散式架構中預設不會將**.xml檔案拷入到專案中 解決方法:修改**-mapper的pom檔案,在pom檔案

mybatismybatis訪問報錯:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

配置 esp 文件中 map XML 需要 r.java文件 指定 space mybatis訪問報錯:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 需要檢

MyBatis不能xml:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

臨睡前解決了一個問題: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 檢查以下配置: 1:檢查xml檔案所在的package名稱是否和interface對應的packa

關於在整合mybatis、spring、springmvc時出現的Invalid bound statement (not found): 錯誤

今天在使用ssm框架進行ajax使用測試的時候,copy了教學視訊的程式碼,程式結構如下: sping的關於mybatis的配置語句如下: <!-- mapper的加強————————1.配置SqlSessionFactory --> <bean class="org

IDEA中spring boot MyBatis出現Invalid bound statement (not found)錯誤

同樣的專案在eclipse中沒有問題在idea中mybatis會報Invalid bound statement (not found)錯誤 原因是沒有找到相對應的XML檔案,找了很長時間發現在編譯後的classes路徑下並沒有相應的XML檔案,這是因為IDEA在編譯的時候

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) mybatis無效的宣告

(1) mapper介面類和mapper.xml是否在同一個包下,檔名稱是否一致(僅字尾不同):經過實際檢驗,這個並不需要在同一個包下面,通常mapper.xml檔案是存放在src/main/resources目錄下,而mapper介面類是在src/main/java目錄下面

mybatis整合springmvc時的錯誤org.apache.ibatis.binding.BindingException: Invalid bound statement (not found

今天在除錯mybatis,新增一個搜尋功能的時候報了一個這個錯誤 <span style="white-space:pre"> </span>rg.springframewor