Console error message :
Description: Field userRepository in
com.example.demo.controller.UserController required a bean of type
'com.example.demo.repository.UserRepository' that could not be found. Action:
Consider defining a bean of type 'com.example.demo.repository.UserRepository'
in your configuration.
@Repository public interface UserRepository extends JpaRepository<User, Long> {
@RestController public class UserController { @Autowired private
UserRepository userRepository; @GetMapping("/simple/{id}") public User findById(
@PathVariable Long id) { return this.userRepository.findOne(id); } }
send spring Scan to file
resolvent : Start the class for scanning
@SpringBootApplication @ComponentScan("com")// scanning com All documents under public class
Application { public static void main(String[] args) {
Application.class,args); } }

Translated from