为了账号安全,请及时绑定邮箱和手机立即绑定

注解报错找不到

https://img1.sycdn.imooc.com//5bbf513a000136d804980239.jpg

https://img1.sycdn.imooc.com//5bbf513b0001156d02900278.jpg

https://img1.sycdn.imooc.com//5bbf513b0001437105420349.jpg

https://img1.sycdn.imooc.com//5bbf513b0001006b09000329.jpg


报错:

 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)}


想请大家帮忙看看,谢谢啦!!


正在回答

4 回答

类地址需要改成 你自己的

0 回复 有任何疑惑可以回复我~
#1

Serena_Cecilia 提问者

类地址?就是包的引入那里吗?是没有问题的
2018-10-12 回复 有任何疑惑可以回复我~

com.serena.ioc.injection.dao.InjectionDAO   你引包引错了  应该改是com.serena.injection.dao.InjectionDAO

0 回复 有任何疑惑可以回复我~
#1

Serena_Cecilia 提问者

哦哦哦!对诶!太感谢了!
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  文件 对吗?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

注解报错找不到

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信