天天看點

關于SpringMVC中org.springframework.beans.factory.BeanCreationException: Could not autowire field:的問題的解決

在idea中編寫Spring MVC+mybatis項目時報下面錯誤:

關于SpringMVC中org.springframework.beans.factory.BeanCreationException: Could not autowire field:的問題的解決

代碼上提示的錯誤為:

關于SpringMVC中org.springframework.beans.factory.BeanCreationException: Could not autowire field:的問題的解決

經排查發現是dao層注解沒有寫,導緻無法織入。

總結:遇到上面的錯誤時大緻有三種可能情況:

第一、xml配置檔案不對。

第二、注解沒加

第三 、包沖突

繼續閱讀