Autowiring :expected at least 1 bean which qualifies as autowire candidate for this dependency

前端 未结 5 1720
终归单人心
终归单人心 2021-01-12 06:16

Okay, I know that there are many questions asked around the same topic. But I cant seem to make anything work. It also might be the case that I am yet to completely understa

5条回答
  •  情歌与酒
    2021-01-12 06:37

    I am able to run your application with some changes on annotation side.

    I have used same classes which are given in question. Please see below structure and configuration used. Directory Structure

    I have used packages as below and added your classes,
    com.rcmutha.usl.controller
    com.rcmutha.usl.repository

    @SpringBootApplication
    @ComponentScan({"com.rcmutha*"})
    @EntityScan("com.rcmutha*")
    @EnableJpaRepositories("com.rcmutha*")
    public class Application {
    
        public static void main(String[] args) {
            SpringApplication.run(Application.class, args);
        }
    }
    

    For complete code : click here for code

提交回复
热议问题