在学习MyBatis时候,在sqlMapConfig.xml中导入xxxMapper.xml,却发现死活找不到xxxMapper.xml。特此记录下解决方法。

运行项目发生以下报错提示Could not find resource com/jundeng/mapper/UserMapper.xml

org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com.samarua.mapper.UserMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/jundeng/mapper/UserMapper.xml

再看目录结构,UserMapper.xml明明是存在的。

解决办法1
sqlMapConfig.xml中的引用路径的.改为/

    <mappers><!--com.jundeng.mapper.UserMapper.xml--><mapper resource="com/jundeng/mapper/UserMapper.xml"></mapper></mappers>

解决办法2
当替换后还无法解决问题的,则是maven目录结构产生了错误,此时需要删除原有目录并重新创建,在创建多级目录时,目录名也应使用com/jundeng/mapper而不是com.jundeng.mapper

IDEA MyBatis 报错:Could not find resource com/xxx/xxxMapper.xml相关推荐

  1. [报错]Could not find resource com/xxx/xxxMapper.xml

    这个Could not find resource com/xxx/xxxMapper.xml报错出现以后, 尝试了各种办法, 难受了好几天, ,最后找人帮忙看, 终于解决. 问题都出自mybatis ...

  2. Mybatis报错Could not find resource mybatis.xml

    Mybatis报错Could not find resource mybatis.xml 初习Mybatis遇到找不到资源问题 第一种情况 解决方法 第二种情况 初习Mybatis遇到找不到资源问题 ...

  3. Mybatis报错:Could not find resource mybatis-conf.xml

    Mybatis报错:Could not find resource mybatis-conf.xml 报错截图: 报错内容: java.io.IOException: Could not find r ...

  4. 已解决mybatis报错:Invalid bound statement (not found)

    已解决mybatis报错:Invalid bound statement (not found) 文章目录 报错问题 解决方法 福利 报错问题 之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一 ...

  5. mybatis报错 Invalid bound statement (not found)

    mybatis报错 Invalid bound statement (not found) 第一步:查看接口mapper和对应的xml文件的id是否一致 第二步:是由于maven默认加载机制造成 ma ...

  6. Mybatis报错:Could not resolve type alias

    一.问题描述 打包项目成jar包,启动莫名其妙的mybatis报错如下: org.springframework.core.NestedIOException: Failed to parse map ...

  7. Spinner 使用的使用 报错:ArrayAdapter requires the resource ID to be a TextView

    Spinner 使用的使用 报错:ArrayAdapter requires the resource ID to be a TextView 的问题 是修改layout的最外成不是使用TextVie ...

  8. mybatis报错There is no getter for property named '***' in 'class ***'

    mybatis报错There is no getter for property named '***' in 'class ***', 检查一看是xml中映射字段拼写错误,大小写. 有的时候用插件生 ...

  9. 异常处理:Mybatis报错:There is no getter for property named ‘xxxx‘ in ‘class xxx‘

    异常处理:Mybatis报错:There is no getter for property named 'xxxx' in 'class xxx' 参考文章: (1)异常处理:Mybatis报错:T ...

最新文章

  1. 黑科技抗疫,Python开发者大集结!
  2. SQL SERVER数据库中的数据类型 转
  3. 我的世界1.7.2 java_我的世界Java版1.7版本种子分享
  4. 支持林嘉文老师竞选IEEE Circuits and Systems Society Member-at-Large (BoG)
  5. SQL_EXEC_ID分析(转帖)
  6. Android P版自定义开关机动画
  7. 【ROS学习笔记】(七)服务端Server的实现
  8. 论文多个实验时VS或Unity工程需要每次新建吗?
  9. mysql创建学生信息选课系统_MySQL学生信息管理系统
  10. java 自由落体for语句_JAVA 自由落体和平抛无能运动
  11. 2019JAVA面试题精粹附答案
  12. X264实现H264编码以及MediaMuxer的另类用法「第八章,Android音视频编码那点破事」
  13. 年货:Python技术知识清单(数据分析)
  14. Airflow实战--获取REST参数并通过Xcom传递给Bash算子
  15. 流量、技术、超级APP,百度吹响国潮IP进攻号
  16. javascript的getDay()方法
  17. Python3与SQLServer、Oracle、MySql的连接方法
  18. 仿京东左侧菜单弹出html代码,一个类似京东网页左侧菜单扩展的特效代码
  19. 深度学习中的优化函数
  20. 全球化观点的生产模式

热门文章

  1. 大规模SNS中兴趣圈子的自动挖掘
  2. 详解redis5.x版本
  3. 字节LastDay,告别十个月的实习生活,流水账与一些思考
  4. homebrew的安装
  5. python namedtuple_python 简单了解namedtuple
  6. 水下超声波测距c语言程序,51单片机超声波测距C程序
  7. 对 原子性,可见性的理解
  8. kdd 2021 多网络挖掘的新前沿:近期发展和未来趋势
  9. MySQL 修改数据表sql语句
  10. 余三码和8421码对比