UnsatisfiedDependencyException: Error creating bean with name

后端 未结 19 1030
遇见更好的自我
遇见更好的自我 2020-11-30 01:47

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

19条回答
  •  清歌不尽
    2020-11-30 02:16

    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.

提交回复
热议问题