1. 程式人生 > >spring boot mybatis Invalid bound statement (not found)

spring boot mybatis Invalid bound statement (not found)

問題描述:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.idark.modules.user.service.UserService.findUsers
    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:225) ~[mybatis-3.4.4.jar:3.4.4]
    at org.apache.ibatis.binding.MapperMethod
.<init>(MapperMethod.java:48) ~[mybatis-3.4.4.jar:3.4.4] at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65) ~[mybatis-3.4.4.jar:3.4.4] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) ~[mybatis-3.4.4.jar:3.4.4] at com.sun.proxy.$Proxy55.findUsers
(Unknown Source) ~[na:na] at com.idark.modules.user.UserController.getUsers(UserController.java:27) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_73] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_73] at sun.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_73] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_73] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:208) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:135) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:859) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:769) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:86) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:970) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:904) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:971) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:863) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:848) ~[spring-webmvc-5.0.0.RC2.jar:5.0.0.RC2] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:199) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.0.RC2.jar:5.0.0.RC2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.15.jar:8.5.15] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.15.jar:8.5.15] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_73] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_73] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.15.jar:8.5.15] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_73]

初一看到這個問題會以為是mapper.xml檔案沒有獲取到。有過使用maven構建ssm專案經驗的朋友應該有體會,遇到這種就直接加一段pom配置就好了(資源拷貝)。

springboot中是不是也是這樣呢?

看一看編譯之後的目錄就知道了~~
這裡寫圖片描述

這裡寫圖片描述

這時候就發現 service 上竟然被注入了proxy “[email protected]” 這樣的mybatis相關的類。

罪魁禍首竟然是因為配置的mapper掃描的路徑包括了太多的bean 會給service的dean也注入mybatis相關的代理類
這裡寫圖片描述

改成這樣就OK了(僅掃描mapper對應的包):
這裡寫圖片描述

相關推薦

spring boot mybatis Invalid bound statement (not found)

問題描述: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.idark.modules.user.service.UserServic

[Mybatis] Invalid bound statement (not found): com.xxx.dao.UserInfoMapper.insertSelective

Invalid bound statement (not found): com.example.core.common.dao.UserInfoMapper.insertSelective mybatis 整合spring-boot、postgresql時發生,主要原因是g

Maven專案mybatis Invalid bound statement (not found)解決方法

最近因為工作需要,要學習mybatis框架。在新增好一些依賴之後,通過mybatis進行資料庫的crud操作。但是在測試的時候總是報mybatis:Invalid bound statement (not found)。在網上搜索了好久,最後終於發現了問題的所在,現在把它記錄下來,供大家參考: 在mappe

mybatis invalid bound statement (not found) 當心檔案確實不存在

前言:本人在將不適用maven的專案轉化為maven專案後,遇到了 invalid bound statement (not found),百思不得其解,因為此前是可以執行的,而轉為maven專案後,可以正常執行maven clean install 命令打包釋出。但是訪問

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

spring boot 整合mybatis:org.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 (

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

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

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

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

IDEA中Spring Boot專案MyBaits提示Invalid bound statement (not found)錯誤

一個SpringBoot專案在STS中是正常的,沒有任何問題,但是匯入到IDEA中之後啟動就提示org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)錯

Mybatis-Spring掃描路徑有重疊導致Invalid bound statement(not found)問題

scan 技術分享 perl weight intra source action 有效 加載 背景 近日,某個系統的測試環境mybatis總是報Invalid bound statement(not found)異常,導致tomcat容器無法啟動。異常信息如下: org.

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

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

【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的binding錯誤:Invalid bound statement (not found)

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

MyBatis使用動態代理報 invalid bound statement (not found) 錯

ali col ati mapper 文件中 tis bound inter 一個 這個問題網上大部分都說xml文件中的路徑不對 或者是resources之類的問題,如果那些文章的解決方案解決不了你的問題的話,可以看一下我遇到的這種情況: Mapper Interface

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 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

解決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、檢

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 報錯 Invalid bound statement (not found)

在使用springMVC 和 mybatis 整合時,報如下錯誤: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.wechatlearning.permission

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

Invalid bound statement (not found): 找不到執行的函式; 轉載: https://www.cnblogs.com/liaojie970/p/8034525.html Invalid bound statement (not found)錯誤的可能原因: