Springboot構成mybatisエラー[Request processing failed;nested exception is org.apache.ibatis.binding.Bind

1223 ワード

一般的にこのような間違いのいくつかの原因を報告します.
[Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
1.mavenプロジェクトpom.xmlファイルにsqlプロファイルがリソースファイルとして導入されていないため、sqlが見つからず、pomで解決策が見つからない.xmlファイルのbuildノードの下に次の構成を追加します.

    
        ${basedir}/src/main/resources
        
            **/*.yml
        
    
      
        ${basedir}/src/main/resources 
          
            **/*.properties 
          
    
    
        ${basedir}/src/main/resources
        
            **/*.xml
        
    
    
        ${basedir}/src/main/java
        
            **/*.xml
        
    

以上のresourcesノードはbuildの直接サブノードで、位置は間違いありません
 
2.sql mapper.xmlで構成されたsql文idは、インタフェースmapperでのメソッド名とは異なり、特に大文字と小文字の誤り、単語のスペルミスなど、xmlで構成されたid属性がインタフェースファイルのメソッド名と同じであることを保証すると、一致して見つかります.