出现以下错误解决方法
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'addAndShowQuestionAction': Unsatisfied dependency expressed through field 'answerService';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'answerService': Unsatisfied dependency expressed through field 'answerDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.dao.IAnswerDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
我的天,纠结了半天,结果是不管你的实体类是继承了类还是接口,都要把@Repository写在最后的实现类上,写在接口上没用,写在父类上也没用