首页 > 其他分享 >Mapper that could not be found

Mapper that could not be found

时间:2023-01-05 14:58:10浏览次数:51  
标签:Mapper mapper 数据源 could 扫描 MapperScan found classpath

现象1 mapper 资源扫不到

resources 建的是 目录 ,不是 package 所以如果直接 a.b 的方式创建,会扫描不到 mapper.xml 文件
image
image
image

现象2 缺少配置文件 HisDruidConfig

SpringBoot 配置多数据源

现象3 没有启动添加扫描

启动项缺少扫描 MapperScan
//@MapperScan(basePackages ={"com.iron.his.mapper"} ) -- 如果两个MapperScan 就需要 classpath: 改成 classpath*

这边多数据源,放到了 IronDruidConfig、HisDruidConfig 中处理

标签:Mapper,mapper,数据源,could,扫描,MapperScan,found,classpath
From: https://www.cnblogs.com/vipsoft/p/17027515.html

相关文章