[Solved] org.springframework.beans.factory.UnsatisfiedDependencyException:


When you extend from Repository you have to provide two generics:

  • The type of the model (postJob)
  • The type of the ID (field with @Id) annotation

In your case the @Id annotated field is a long, while your repository extends from Repository<postJob, String>. This causes trouble, because now Spring is unable to find a findOne() method that has a String parameter.

To fix it you have to fix the generic and extend from Repository<postJob, Long>.


Please keep also in mind that fieldnames have to start with lowercase (unlike INR, Budget, Summary, Location, …) and that class names start with a capital letter (unlike postJob).

I’m not sure if this will cause other issues, but some frameworks require proper field/getter/setter naming to be able to work.

0

solved org.springframework.beans.factory.UnsatisfiedDependencyException: