spring boot一个模块加载不到引用另一个模块的mapper.xml报错org.apache.ibatis.binding.BindingException: Invalid bound sta

  • Post author:
  • Post category:其他


场景:parent项目有两个子模块,分别是shiro和server,两个子模块各自有各自的实体类、mapper,然后server需要引用shiro中的实体类和mapper。已经在启动类添加注解配置扫描包了,结果还是报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)。

解决方案:在server的配置文件中配置mapper地址修改为扫描所有即可。

修改前:

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

修改后:

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



版权声明:本文为iamlzyoco原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。