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.
UserRepository:
@Repository public interface UserRepository extends JpaRepository<User, Long> {
}
UserController:
@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) { SpringApplication.run(
Application.class,args); } }

Translated from https://stackoverflow.com/questions/40384056/consider-defining-a-bean-of-type-package-in-your-configuration-spring-boot