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

来源:4-1 基于bootstrap开发页面结构

qq_纵横_11

2019-03-15 11:13

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

写回答 关注

2回答

  • 慕工程1333434
    2019-05-20 15:22:04

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

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

  • jisu_che
    2019-03-16 14:19:39

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


Java高并发秒杀API之web层

Java实现高并发秒杀API的第三门课,介绍Web层的设计和实现

66079 学习 · 395 问题

查看课程

相似问题