org.springframework.web.util.NestedServletException: Request processing failed; nested exception错误解决

##出现
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.hyl.mapper.UserMapper.getUser

##原因
此异常的原因是由于mapper接口编译后,在同一个目录下没有找到mapper映射文件而出现的。

##解决方法
在pom.xml中添加

<build>
  <resources>
    <resource>
      <directory>src/main/java</directory>
      <includes>
        <include>**/*.properties</include>
        <include>**/*.xml</include>
      </includes>
      <filtering>false</filtering>
    </resource>
  </resources>
</build>

版权声明:本文为qq_46023503原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。