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

总是显示serviceimpl的seckilldao属性无法注入

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'seckillServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.seckill.dao.SeckillDao org.seckill.service.impl.SeckillServiceImpl.seckillDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.seckill.dao.SeckillDao] 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)}

正在回答

3 回答

NoSuchBeanDefinitionException: No qualifying bean of type [org.seckill.dao.SeckillDao] found for dependency

容器中没有这个bean,需要在dao加上@Repository

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

我猜你是在seckillServiceImpl上加了@Autowired注解,如果是这样,你将seckillServiceImpl改为seckillService就可以了


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

举报

0/150
提交
取消

总是显示serviceimpl的seckilldao属性无法注入

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