IDEA Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource ***

来源:互联网 发布:龙腾世纪2 知乎 编辑:程序博客网 时间:2024/05/22 15:13

报错:

org.apache.ibatis.exceptions.PersistenceException:
Error building SqlSession.
The error may exist in entity/EmpMapper.xml
Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource entity/EmpMapper.xml

原因: idea不会编译src的java目录的xml文件

解决方法一:

将IDEA maven项目中src源代码下的xml等资源文件编译进classes文件夹

具体操作:配置maven的pom文件配置,在节点下添加 代码:

<build>    <resources>        <resource>            <directory>src/main/java</directory>            <includes>                <include>**/*.xml</include>            </includes>        </resource>    </resources></build>

解决方法二:

将IDEA maven项目中src源代码下的xml等资源文件放到resources文件夹下

阅读全文
0 0
原创粉丝点击