用idea运行SSM时无法绑定Mapper.xml( Invalid bound statement (not found))
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
照着视频打代码, 却发现无法运行,视频里用的是eclipse,我用的是idea, 经过研究是idea与eclipse的不同, 试了好多篇文章发现只有这一篇的解法能解决:
http://www.cnblogs.com/aioria13/p/6224489.html
原因: 部署后target里面没有mybatis的配置文件*.xml
解决方法:在pom.xml中通过maven强制将*.xml文件一起发布
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
< build >
< plugins >
< plugin >
< groupId >org.apache.maven.plugins</ groupId >
< artifactId >maven-compiler-plugin</ artifactId >
< configuration >
< source >1.8</ source >
< target >1.8</ target >
</ configuration >
</ plugin >
</ plugins >
< resources >
< resource >
< directory >src/main/java</ directory >
< includes >
< include >**/*.properties</ include >
< include >**/*.xml</ include >
</ includes >
< filtering >false</ filtering >
</ resource >
</ resources >
</ build >
|