搭建了一个ssm项目,启动报错Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/cqupt/paging/dao/User.xml
我看了一下路径没错,名字也没有写错
网上找了一下资料解决了,记录一下
我用maven管理,在target下并没有将User.xml,出错原因就是maven编译时没有将xml文件放进去,所以才会找不到User.xml文件
解决方法,在pom.xml加入:
1 <!--classpath--> 2 <build> 3 <resources> 4 <resource> 5 <directory>src/main/java</directory> 6 </resource> ta 8 <directory>src/main/resources</directory> 9 <includes> 10 <include>**/*xml</include> 11 <include>**/*.properties</include> 12 </includes> 13 </resource> 14 </resources> 15 </build>
或者手动将User.xml放入targegt对应的路径下
时间: 2024-12-29 01:31:53