IDEA MyBatis 报错:Could not find resource com/xxx/xxxMapper.xml
在学习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相关推荐
- [报错]Could not find resource com/xxx/xxxMapper.xml
这个Could not find resource com/xxx/xxxMapper.xml报错出现以后, 尝试了各种办法, 难受了好几天, ,最后找人帮忙看, 终于解决. 问题都出自mybatis ...
- Mybatis报错Could not find resource mybatis.xml
Mybatis报错Could not find resource mybatis.xml 初习Mybatis遇到找不到资源问题 第一种情况 解决方法 第二种情况 初习Mybatis遇到找不到资源问题 ...
- Mybatis报错:Could not find resource mybatis-conf.xml
Mybatis报错:Could not find resource mybatis-conf.xml 报错截图: 报错内容: java.io.IOException: Could not find r ...
- 已解决mybatis报错:Invalid bound statement (not found)
已解决mybatis报错:Invalid bound statement (not found) 文章目录 报错问题 解决方法 福利 报错问题 之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一 ...
- mybatis报错 Invalid bound statement (not found)
mybatis报错 Invalid bound statement (not found) 第一步:查看接口mapper和对应的xml文件的id是否一致 第二步:是由于maven默认加载机制造成 ma ...
- Mybatis报错:Could not resolve type alias
一.问题描述 打包项目成jar包,启动莫名其妙的mybatis报错如下: org.springframework.core.NestedIOException: Failed to parse map ...
- Spinner 使用的使用 报错:ArrayAdapter requires the resource ID to be a TextView
Spinner 使用的使用 报错:ArrayAdapter requires the resource ID to be a TextView 的问题 是修改layout的最外成不是使用TextVie ...
- mybatis报错There is no getter for property named '***' in 'class ***'
mybatis报错There is no getter for property named '***' in 'class ***', 检查一看是xml中映射字段拼写错误,大小写. 有的时候用插件生 ...
- 异常处理: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 ...
最新文章
- 黑科技抗疫,Python开发者大集结!
- SQL SERVER数据库中的数据类型 转
- 我的世界1.7.2 java_我的世界Java版1.7版本种子分享
- 支持林嘉文老师竞选IEEE Circuits and Systems Society Member-at-Large (BoG)
- SQL_EXEC_ID分析(转帖)
- Android P版自定义开关机动画
- 【ROS学习笔记】(七)服务端Server的实现
- 论文多个实验时VS或Unity工程需要每次新建吗?
- mysql创建学生信息选课系统_MySQL学生信息管理系统
- java 自由落体for语句_JAVA 自由落体和平抛无能运动
- 2019JAVA面试题精粹附答案
- X264实现H264编码以及MediaMuxer的另类用法「第八章,Android音视频编码那点破事」
- 年货:Python技术知识清单(数据分析)
- Airflow实战--获取REST参数并通过Xcom传递给Bash算子
- 流量、技术、超级APP,百度吹响国潮IP进攻号
- javascript的getDay()方法
- Python3与SQLServer、Oracle、MySql的连接方法
- 仿京东左侧菜单弹出html代码,一个类似京东网页左侧菜单扩展的特效代码
- 深度学习中的优化函数
- 全球化观点的生产模式