Mapped Statements collection does not contain value for 解決方法(筆記)
阿新 • • 發佈:2018-12-14
1.mybatis的對映檔案的命令空間與介面的全限定名不一致;
2有可能mybatis的對映檔名字與介面的類名字不一致;
3.還有一種情況就是介面宣告的方法在對映檔案裡面沒有。
4.maven專案中 dao中的xml檔案沒有被打包,可以看一下classes資料夾,如果沒有則在pom中配置resource路徑
如下:
<build> <!-- 專案名稱 --> <finalName>maven</finalName> <!--配置打包的路徑,預設只會打包resources中的配置檔案,其中*/這樣的寫法,是為了保證各級子目錄下的資原始檔被打包。--> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.tld</include> </includes> <filtering>false</filtering> </resource> <resource> </build>