论坛上的各位大神们好,最近本人因dao注入到serviceImp类出现了问题,绞尽脑汁 花了大量的时间也没解决,只知到问题原因是serviceipm那里注入dao出现了错误,希望看到此贴的朋友能指点一下,本人感激不尽 代码如下:
就是这里serviceImp类userBasicInfoDao.insertUser(userBasicInfo)出现了问题,导致创建ben失败,但就是不知错在哪
启动报错的完整代码如下:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBasicInfoAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private music.struts2.service.UserBasicInfoService music.struts2.action.UserBasicInfoAction.userBasicInfoService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBasicInfoServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private music.struts2.dao.UserBasicInfoDao music.struts2.service.impl.UserBasicInfoServiceImpl.userBasicInfoDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [music.struts2.dao.UserBasicInfoDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)