1. 程式人生 > >mybatis整合springmvc時的錯誤org.apache.ibatis.binding.BindingException: Invalid bound statement (not found

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

今天在除錯mybatis,新增一個搜尋功能的時候報了一個這個錯誤

<span style="white-space:pre">	</span>rg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException:
 Invalid bound statement (not found): com.weitongming.mapper.BrandMapper.queryBrandsByName
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:980)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.apache.logging.log4j.core.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:66)
root cause
網上一番搜尋,得出答案如下:

1、請檢查你的**mapper.xml值配置的namespace有沒有對應上你的interface藉口,請注意,是要完全對應上

<span style="white-space:pre">	</span><!-- 繫結介面 -->
<span style="white-space:pre">	</span><mapper namespace="com.weitongming.mapper.BrandMapper"> 
<span style="white-space:pre">	</span>//介面定義
<span style="white-space:pre">	public interface BrandMapper {</span>}
大家可以在定義的時候習慣性的按ctrl,再把滑鼠移上去,如果能有點選超連結的效果,那麼意味著你的配置檔案是能訪問到原始檔的,說明起碼語法沒錯。

2、在xml值之中配置的方法在介面之中不存在,執行的時候也會報錯

3、請注意返回值的型別,如果介面返回的物件是個list,那麼xml配置的select的resultMap一定要配置,不能配置resultType

相關推薦

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

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

mybatis配置出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

比較 tis bin per 所在 exce map 出現 name 如果出現: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper int

【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

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) 需要檢

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

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

pri ssp path 內容 方案 sta 問題 xmapp not 最近在學習SpringBoot,遇到些異常情況: 1、異常信息 org.apache.ibatis.binding.BindingException: Invalid bound statement (

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報錯org.apache.ibatis.binding.BindingException: Invalid bound statement not found異常

問題記錄 問題是:找不到你專案對映檔案(*.xml) 在application.properties檔案中新增 mybatis.mapper-locations=classpath*:/mapper/**Mapper.xml 如果屬性檔案是.yml的,新增 mybati

SpringBoot整合mybatis報錯:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

無法綁定 boot strong https tails tis 查看 csdn sta 在使用SpringBoot整合mybatis時一直報錯:org.apache.ibatis.binding.BindingException: Invalid bound statem

關於mybatisorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 錯誤的問題。

資源文件 classes intellij 總結 ibatis namespace select 兩種 ssm 困擾了我兩條的問題: 最近從eclipse轉到intellij idea,確實比eclipse好用太多,但是也是各種不熟悉,導致了很多問題,本來搭好的maven

【ide】MyBatis報錯: 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中的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

解決mybatis中的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)問題: 1、檢查mapper.xml與mapper.java的namespace中的名字是否相符合; 2、檢

關於 “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 錯誤的問題。

springboot整合mybatis,出現 “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 錯誤原因: 1、dao層mapper介面有沒有@Mapper註解,或者啟動類

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

當出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)怎麼解決

當出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)時怎麼解決 這是樓主遇見的錯誤用maven整合ssm的時候出現的。出現這種錯誤的原因分析: 1、dao和mapper裡

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)錯誤幾種解決方案

報錯資訊: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.study.server.mapper.UserMapper.insert at org.apache.ibat

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

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

maven 專案,mybatis報錯org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

maven管理的spring專案在打包install啟動後,mybatis報錯org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): … 錯誤描述: 專案使用mybat

maven專案下報錯mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)

maven專案下報錯mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found 問題原因 解決辦法 其它原因

關於Mybatis出現:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

最近一直都加班,但是呢 出現的問題以及解決方案:框架是(SSM) 關於Mybatis出現的一些繫結問題哈: 直接上截圖,錯誤程式碼: org.springframework.web.util.NestedServletException: Request proc