@Autowired - No qualifying bean of type found for dependency

前端 未结 17 1569
自闭症患者
自闭症患者 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:39

    I ran in to this recently, and as it turned out, I've imported the wrong annotation in my service class. Netbeans has an option to hide import statements, that's why I did not see it for some time.

    I've used @org.jvnet.hk2.annotations.Service instead of @org.springframework.stereotype.Service.

提交回复
热议问题