Mapped Statements collection does not contain value for xxxx
原因是 maven package的时候 src/main/java下面的xml文件没有拷贝进war包,导致部署到服务器上会出错
解决方法:
pom.xml 增加:
1 <!-- Copy xml files to main output folder, because the compiler will not 2 copy files other than ".java". --> 3 <resources> 4 <resource> 5 <directory>src/main/java</directory> 6 <includes> 7 <include>**/*.xml </include> 8 </includes> 9 </resource> 10 <resource> 11 <directory>src/main/resources</directory> 12 <includes> 13 <include>*.xml </include> 14 <include>*.properties </include> 15 </includes> 16 </resource> 17 </resources>
增加在<build></bulid>里面