注解報(bào)錯(cuò)找不到
報(bào)錯(cuò):
?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)}
想請大家?guī)兔纯?,謝謝啦??!
2018-10-12
類地址需要改成 你自己的
2018-10-12
還想請問一下,就是視頻后面對setter和構(gòu)造函數(shù)加sutowired的注解,會(huì)不會(huì)不是那么必要?
2018-10-12
com.serena.ioc.injection.dao.InjectionDAO ? 你引包引錯(cuò)了 ?應(yīng)該改是com.serena.injection.dao.InjectionDAO
2018-10-12
<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 ?文件 對嗎?