天天看点

关于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配置文件不对。

第二、注解没加

第三 、包冲突

继续阅读