mybatis Mapper方法整理到公共jar后 Invalid bound statement (not found)问题

之前项目自己的mapper 和 mapper.xml都是在自己本身项目下

后来业务拓展项目增多,有一些公共的功能 在多个应用重复造轮子  为了解决这个问题, 新建了一个 share的jar   后端服务 和job服务都引用这个jar 可以实现调用同一个方法

但是整理好之后发现
 Invalid bound statement (not found)问题

问题就出配置这里

#mybatis
mybatis.mapperLocations=classpath*:mapper/*.xml

之前的配置是

#mybatis
mybatis.mapperLocations=classpath:mapper/*.xml

MapperLocation由classpath改为classpath*,加一个*号才会扫描jar包中的mapper。

 

谨记!

posted @ 2021-12-13 17:27  loveCrane  阅读(331)  评论(0编辑  收藏  举报