我service的测试类ok的,也能访问index.jsp,就是访问list.jsp报错,,哪位大神帮忙看一下,,谢谢!
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)}
Caused by: 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)}
web.xml
spring-web.xml
你的SeckillServiceImpl这个类是不是没有加注解,比如:@Service。不加注解的话,BeanFactory就不会知道他是一个Bean,这样,在SeckillController 中使用@Autowired注解注入的时候,Spring容器就会找不到对应的Bean