今天在学习MyBatis时,IDEA报错了:Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource UserMapper.xml

仔细查看了一下,是我sqlMapConfig.xml中映射文件配置错了
文件用 / 分隔
<mappers>
<mapper resource="com/arun/mapper/UserMapper.xml"></mapper>
</mappers>
解决MyBatis配置错误:找不到UserMapper.xml资源
在学习MyBatis过程中遇到IDEA报错:Error parsing SQL Mapper Configuration,原因是sqlMapConfig.xml中UserMapper.xml的资源配置错误。问题出在使用了/作为路径分隔符,正确配置应使用相对路径或者类路径(classpath*:)来引用资源文件。

被折叠的 条评论
为什么被折叠?



