当前位置: 代码迷 >> 综合 >> mybatis程序报错:ibatis.binding.BindingException: Invalid bound statement (not found)
  详细解决方案

mybatis程序报错:ibatis.binding.BindingException: Invalid bound statement (not found)

热度:61   发布时间:2023-09-29 07:50:13.0

我的mapper文件不是在resource下面的,而是和java在一起。

mybatis程序报错:ibatis.binding.BindingException: Invalid bound statement (not found)

所以在构建的时候没有把mapper文件夹以及下面的.xml文件构建出来。

所以需要在pom文件中配置:

mybatis程序报错:ibatis.binding.BindingException: Invalid bound statement (not found)

<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins><resources><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include><include>**/**</include></includes></resource><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes><!-- 是否替换资源中的属性 --><filtering>false</filtering></resource></resources></build>

 然后从新构建就行了

  相关解决方案