springboot项目mybatis打jar包不搭边xml文件

使用springboot 加载mybatis,打包成功,结果在测试服务器上一直报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 

经过排查,结果是jar中没有打包mybatis中的xml文件的原因

解决办法:

application.yml配置文件中配置xml路径

mybatis:
  mapper-locations: classpath*:src/main/java/com/cjwl/mapper/*.xml

猜你喜欢

转载自blog.csdn.net/guangyingposuo/article/details/85230881