class path resource [mapper/*.xml] cannot be opened because it does not exist

项目场景:

在使用springboot整合mybatis遇到的问题


问题描述

 后面大致的意思是说*.xml不存在


解决方案:

查看application.properties或者application.yml配置文件是否有关于mybatis的配置,如果存在则查看是否将mapper-locations写成config-location

注意:config-location是确定mybatis-config.xml文件位置的,而mapper-locations是用来注册你写的xxxmapper.xml文件。

  

mybatis:
  mapper-locations: classpath:mapper/*.xml


  • 7
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,问题是关于一个文件路径的错误。根据引用\[1\]和引用\[2\],错误信息显示"class path resource \[config/mybatis/mapper3/\] cannot be resolved to URL because it does not exist",这意味着指定的文件路径不存在。根据引用\[3\]中的配置信息,可以看到mybatis的配置文件应该位于"classpath:mybatis/mybatis-config.xml"。因此,问题中提到的文件路径应该是错误的,可能是拼写错误或者文件确实不存在。请检查文件路径是否正确,并确保文件存在于指定的位置。 #### 引用[.reference_title] - *1* *2* [class path resource [config/mybatis/mapper3/] cannot be resolved to URL because it does not exist](https://blog.csdn.net/qq_39308071/article/details/108099653)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v4^insert_chatgpt"}} ] [.reference_item] - *3* [【springboot】class path resource [mybatis/mybatis-config.xml] cannot be opened because it does not ...](https://blog.csdn.net/Mrerlou/article/details/120723471)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v4^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值