SSM整合junit单元测试之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

想用SSM做一点小测试,项目整合完毕,直接使用junit测试mybatis,出现如下错误(SuperTest类中进行了spring运行环境加载):

解决思路:

检查mapper接口与mapper.xml文件名、namespace、statement的id与mapper接口中的方法名

然而发现并没有问题,之前使用Eclipse时遇到过mapper.xml不发布的问题,猜想可能idea也存在这个问题,检查targer目录,发现确实是mapper.xml未发布

需要在maven的<build></build>标签中配置一下内容:

<resources>
     <resource>
         <directory>${basedir}/src/main/java</directory>
               <includes>
                   <include>**/*.xml</include>
               </includes>
      </resource>
</resources>

插入完毕之后重新测试,可以在target目录下看到mapper.xml已经发布,程序正常运行。

原文地址:https://www.cnblogs.com/alphajuns/p/11785541.html

时间: 2024-07-29 15:34:13

SSM整合junit单元测试之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的相关文章

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

最近在学习SpringBoot,遇到些异常情况: 1.异常信息 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hippo.demo.dao.Chapter6DemoMapper.insert 2.解决方案 问题找了很久,发现使用@Select.@Insert.@Update.@Delete注解代替xxxMapper.xml里面的内容,不存在异常,那就是扫描xxxMapper

IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

有时候解决问题不仅仅是解决问题.-----jstarseven 最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA. 整合完了SSM开发框架之后,发布的时候出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found... 一开始以为是自己配置文件写的有问题找了半天也没有问题,之后才发现是自己对IDEA工具使用的不够熟悉. 先说该异常常见解决方案: 一般是xml映射文件有错误.但

转:IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

原文地址:https://www.cnblogs.com/jstarseven/p/5803697.html 有时候解决问题不仅仅是解决问题.-----jstarseven 最近采用了开发工具IDEA开发SSM开发框架完成后,发布的时候出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found... 一开始以为是自己配置文件写的有问题找了半天也没有问题,之后才发现是自己对IDEA工具使用的不够熟

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

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): da.huying.usermanage.mapper.UserMapper.queryUserById    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:196)    at org.apache.ibatis.bindi

IDEA+Maven+Mybatis 巨坑:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.rao.mapper.UserMapper.findAll

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.rao.mapper.UserMapper.findAll at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:227) at org.apache.ibatis.binding.MapperMethod.<init&

通过maven test 报org.apache.ibatis.binding.BindingException: Invalid bound statement

背景 直接使用eclipse工具去执行,没有问题,通过testng.xml去执行,没有问题,但通过mvn clean test执行,就报错,提示org.apache.ibatis.binding.BindingException: Invalid bound statement 解决方法 首先先肯定的是:mybatis的配置是没有问题,因为eclipse可以正常执行: 在eclipse中把mapper的xml文件放到src代码目录下是可以一起打包进classes的,而maven去编译的时候不会,

Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.RuntimeException: org

MyBatis笔记----报错:Exception in thread &quot;main&quot; org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法

报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectarticle at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:230) at or

MyBatis笔记----报错Exception in thread &quot;main&quot; org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

信息: Refreshing org[email protected]41cf53f9: startup date [Wed Apr 05 16:48:12 CST 2017]; root of context hierarchy 四月 05, 2017 4:48:12 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definiti