原因:

解决mapper绑定异常:nested exception is org.apache.ibatis.binding.BindingException:

此异常的原因是由于mapper接口编译后在同一个目录下没有找到mapper映射文件而出现的。由于maven工程在默认情况下src/main/java目录下的mapper文件是不发布到target目录下的。

解决办法:需要在你的xxxx项目的pom文件中添加一下配置

<!-- 如果不添加此节点mapper.xml文件都会被漏掉。 -->

     <build>

          <resources>

            <resource>

                <directory>src/main/java</directory>

                <includes>

                    <include>**/*.properties</include>

                    <include>**/*.xml</include>

                </includes>

                <filtering>false</filtering>

            </resource>

        </resources>

     </build>

相关文章:

  • 2021-09-02
  • 2021-07-01
  • 2021-08-01
  • 2021-07-19
  • 2021-11-01
  • 2021-10-11
  • 2021-12-31
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2021-09-20
  • 2021-10-08
  • 2022-03-02
  • 2021-06-06
  • 2021-08-08
相关资源
相似解决方案