1

I forked a simple spring project from github. When i Run it, It got the following error

Description:

Field userRepository in com.example.demo.service.UserService 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.

1 Answers1

0

Make the spring boot app aware about the repository location

@SpringBootApplication(scanBasePackages={
    "com.example.repository", "com.example.application"})

If it doesn't work then follow below thread.

'Field required a bean of type that could not be found.' error spring restful API using mongodb

Alien
  • 15,141
  • 6
  • 37
  • 57