For several days I\'m trying to create Spring CRUD application. I\'m confused. I can\'t solve this errors.
org.springframework.beans.factory.Unsatisfi
Add @Repository annotation to the Spring Data JPA repo
See if your is missing in either config or context xml file
That might happen because the pojos you are using lack of the precise constructor the service needs. That is, try to generate all the constructors for the pojo or objects (model object) that your serviceClient uses, so that the client can be instanced correctly. In your case,regenerate the constructors (with arguments)for your client object (taht is your model object).
I was facing the same issue, and it was, as i missed marking my DAO class with Entity annotations. I tried below and error got resolved.
/**
*`enter code here`
*/
@Entity <-- was missing earlier
public class Topic {
@Id
String id;
String name;
String desc;
.
.
.
}
The application needs to be placed in the same directory as the scanned package:
If you are using Spring Boot, your main app should be like this (just to make and understand things in simple way) -
package aaa.bbb.ccc;
@SpringBootApplication
@ComponentScan({ "aaa.bbb.ccc.*" })
public class Application {
.....
Make sure you have @Repository and @Service appropriately annotated.
Make sure all your packages fall under - aaa.bbb.ccc.*
In most cases this setup resolves these kind of trivial issues. Here is a full blown example. Hope it helps.