zoukankan      html  css  js  c++  java
  • 出现org.apache.ibatis.binding.BindingException异常

     出现绑定式异常

    查看target文件夹里面再mapper中,发现运行时缺少xml文件

    解决办法

    1、将xml文件复制到target中Mapper文件夹下面。

    2、将xml放到resource目录下

    3、配置文件

    配置文件

    1、在pom文件中添加,指定xml文件位置

     1 <!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
     2 <build>
     3   <resources>
     4     <resource>
     5       <directory>src/main/java</directory>
     6     <includes>
     7       <include>**/*.xml</include>
     8     </includes>
     9       <filtering>false</filtering>
    10     </resource>
    11   </resources>
    12 </build>

    2、在Spring Boot配置文件中添加配置

    #配置mapper xml文件的路径
    mybatis-plus.mapper-locations=classpath:com/xxx/xxx/mapper/xml/*.xml

    完美解决

  • 相关阅读:
    XP显示桌面
    批量改名
    poj 3126 BFS
    poj 3278 BFS
    poj 1426 BFS
    准备打酱油…
    POJ 2243 BFS 和 简单的调试方法学习
    K
    EXCEL fundamentals
    poj 1011 DFS+剪枝
  • 原文地址:https://www.cnblogs.com/HezhenbinGoGo/p/13472383.html
Copyright © 2011-2022 走看看