Serena_Cecilia
2018-10-11 21:34
报错:
Error creating bean with name 'injectionServiceImpl': Unsatisfied dependency expressed through field 'injectionDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.serena.ioc.injection.dao.InjectionDAO' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
想请大家帮忙看看,谢谢啦!!
类地址需要改成 你自己的
还想请问一下,就是视频后面对setter和构造函数加sutowired的注解,会不会不是那么必要?
com.serena.ioc.injection.dao.InjectionDAO 你引包引错了 应该改是com.serena.injection.dao.InjectionDAO
<bean id="injectionService" class="com.imooc.ioc.injection.service.InjectionServiceImpl">
<constructor-arg name="injectionDAO" ref="injectionDAO"></constructor-arg>
</bean>
<bean id="injectionDAO" class="com.imooc.ioc.injection.dao.InjectionDAOImpl"></bean>
看看你的XML 文件 对吗?
Spring入门篇
268786 学习 · 963 问题
相似问题