Reputation: 199
I am trying one basic spring boot demo. I am getting this error.
...
I don't know which code to copy so here is link from the demo https://github.com/PetarRistevski/demo-referrals
This is what I get APPLICATION FAILED TO START
Description:
Field repository in com.petar.demoreferrals.service.impl.UserServiceImpl required a bean of type 'com.petar.demoreferrals.repository.UserRepository' that could not be found.
The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.petar.demoreferrals.repository.UserRepository' in your configuration.
Upvotes: 0
Views: 159
Reputation:
You need to remove the @Profile(“jpa”)
from UserRepository
or you need to set "jpa" in "spring.profiles.default" property like:
spring.profiles.default=jpa
Issue is: you are creating UserRepository
when profile is "jpa" but you haven’t add "jpa" to spring profiles. So spring have not created bean for UserRepository
.
Upvotes: 1