Field studentRepository in com.example.demo.StudentController required a bean of type 'com.example.demo.StudentRepository' that could not be found.
Action:
Consider defining a bean of type 'com.example.demo.StudentRepository' in your configuration.
@RestController public class StudentController { @Autowired private StudentRepository studentRepository; @GetMapping(value = "/findAll") public List studentList(){ return studentRepository.findAll(); } }
StudentRepository inherits JpaRepository, which should be the simplest example
There is only one package in total. SpringBootApplication and Controller are placed under the same package. There should be no ordering problems on the Internet.
StudentRepository is not registered
I solved it myself, the jpa package conflicted.