今天在做谷粒学院时,用到了编写Sql在Mapper的xml中进行多表查询.但是当项目启动后报了以下错误:
这个错误是由Maven默认加载机制造成的
Maven加载时,把Java文件夹下的.java类型文件进行编译,对于其他类型文件,不会加载.
解决方式:
1.赋值xml文件到target目录中
2.把xml文件放到resources目录中
3.通过配置方式实现(推荐使用)
- POM文件中添加配置
- 配置文件中添加xml的路径
启动项目进行测试:—成功
今天在做谷粒学院时,用到了编写Sql在Mapper的xml中进行多表查询.但是当项目启动后报了以下错误:
这个错误是由Maven默认加载机制造成的
Maven加载时,把Java文件夹下的.java类型文件进行编译,对于其他类型文件,不会加载.
解决方式:
1.赋值xml文件到target目录中
2.把xml文件放到resources目录中
3.通过配置方式实现(推荐使用)
启动项目进行测试:—成功
下一篇:计算机网络之第三次实验
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M