Maven下的Web应用部署常见错误(org.apache.ibatis.binding.BindingException: Invalid bound statement)

Maven下的Web应用部署常见错误

  • 部署出现后target中没有mapper.xml文件
    报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
    检查dao包中的.java文件名称是否和.xml名称一致
    mapper.xml的命名空间(namespace)是否和mapper接口的包名一致
    接口方法名是否和select标签id相同
    返回集合尽量使用resultMap(保证resultMap的配置正确)
    Maven默认是不编译xml文件的,检查pom.xml中的<build></build>标签中是否存在下面这段代码

      <resources>  
          <resource>  
              <directory>src/main/java</directory>  
              <includes>  
                  <include>**/*.xml</include>  
              </includes>  
              <filtering>true</filtering>  
          </resource>  
      </resources>
    
posted @ 2019-07-05 16:04  蜀山剑仙  阅读(201)  评论(1编辑  收藏  举报