org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'sysUserControllerl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.haochen.spring_mvc.SysUserControllerl.setSysUserServices(com.haochen.services.SysUserServices); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.haochen.services.SysUserServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {
代码呢,。,,。,。,。,
Error creating bean with name 'sysUserControllerl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.haochen.spring_mvc.SysUserControllerl.setSysUserServices(com.haochen.services.SysUserServices); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.haochen.services.SysUserServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
建议你检查一下sysUserController里面authwired的service实现,可能是impl的时候service标签没检测到
bean创建失败,可能spring-mvc.xml这个配置文件错了。
com.haochen.services.SysUserServices
这个类找不到,
1.你代码没写这个类
2.你代码有,Spring没识别到,为啥没识别:
a.你没注解或没配到XML中
b.你注解了,但类所在的包是Spring自动扫描的盲区
这些是我首先想的
这个类com.haochen.services.SysUserServices上面是否有注解,同时注解扫描路径是否正确。