Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java org.springframework.beans.factory.unsatifiedDependencyException:创建名为';学生服务';_Java_Spring_Spring Mvc - Fatal编程技术网

Java org.springframework.beans.factory.unsatifiedDependencyException:创建名为';学生服务';

Java org.springframework.beans.factory.unsatifiedDependencyException:创建名为';学生服务';,java,spring,spring-mvc,Java,Spring,Spring Mvc,我正在运行一个JavaSpring应用程序,没有使用Spring引导,我收到了以下错误 SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentService': Unsatisfied dependency expressed through field 'studentRep

我正在运行一个JavaSpring应用程序,没有使用Spring引导,我收到了以下错误

SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentService': Unsatisfied dependency expressed through field 'studentRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'studentsystem2.ikubinfo.repository.StudentRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
这是我的rest servlet.xml


这是我的web.xml文件


学生系统2
休息
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/rest-servlet.xml
1.
休息
/*
编辑 StudentRepository.java

package studentsystem2.ikubinfo.repository;
导入org.springframework.data.repository.crudepository;
导入org.springframework.stereotype.Repository;
导入studentsystem2.ikubinfo.entity.Student;
@存储库
公共界面StudentRepository扩展了crudepository{
}

我认为没有找到用于扫描组件的基本包,但我不明白为什么。配置出了什么问题?

我看到了其他问题,但它们没有回答我的问题。请发布studentsystem2.ikubinfo.repository的代码。StudentRepository@ShaileshChandra刚刚发布您是否创建了JPA配置文件,坚持不懈xml@ShaileshChandra没有。我只在application.properties中添加了一些配置属性。顺便说一句,谢谢你帮助我:)