1. 程式人生 > >springboot專案mybatis打jar包不搭邊xml檔案

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