@Autowired - No qualifying bean of type found for dependency

前端 未结 17 1500
自闭症患者
自闭症患者 2020-12-07 15:00

I\'ve started my project by creating entities, services and JUnit tests for services using Spring and Hibernate. All of this works great. Then I\'ve added spring-mvc to make

17条回答
  •  时光说笑
    2020-12-07 15:26

    I had this happen because my tests were not in the same package as my components. (I had renamed my component package, but not my test package.) And I was using @ComponentScan in my test @Configuration class, so my tests weren't finding the components on which they relied.

    So, double check that if you get this error.

提交回复
热议问题