注解報錯找不到
報錯:
?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)}
想請大家幫忙看看,謝謝啦??!
2018-10-12
類地址需要改成 你自己的
2018-10-12
還想請問一下,就是視頻后面對setter和構造函數加sutowired的注解,會不會不是那么必要?
2018-10-12
com.serena.ioc.injection.dao.InjectionDAO ? 你引包引錯了 ?應該改是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 ?文件 對嗎?