解決方法 required a bean of type ‘com.example.day14.mapper.deptmapper‘ that could not be found.

項目報錯,一直提示 解決辦法: 這個錯誤得出現主要是因爲項目沒有掃描到mapper包,@MapperScan 是掃描mapper類的註解。你只需要在項目啓動類上加註解 @MapperScan(「Mapper文件所在的包」),,就不用在每個mapper類上加@MapperScan了。 步驟: 1、複製你的mapper包相對路徑 然後粘貼到你的啓動類 再次運行一下就可以了。
相關文章
相關標籤/搜索