单元测试出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
2017-04-27 18:18
621 查看
在web项目中,通过url访问,里面的mybatis映射能够正常工作,但是运行junit单元测试时却出现“org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)”异常,仔细研究pom文件发现在build里面只包含了src/main/resource目录下的xml文件,而没有包含子目录下的xml文件,添加后正常:
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/src/test/resources</directory>
<includes>
<include>*.xml</include>
<include>**/*.xml</include>
<include>*.properties</include>
</includes>
</resource>
</resources>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/src/test/resources</directory>
<includes>
<include>*.xml</include>
<include>**/*.xml</include>
<include>*.properties</include>
</includes>
</resource>
</resources>
相关文章推荐
- 关于整合SSH,出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- mybatis出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- ssm整合出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- 出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的解决方法
- mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- IDEA的maven项目出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- 出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的解决方法
- 当mybatis整合spring后出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- springboot项目打包后运行报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 关于mybatis的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 异常解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)