I have a service interface UserService and an implementing class UserServiceImpl. When I try to inject UserServiceImpl to a variable in a controller class, it throws an NoSuchBeanDefinitionException. But when I inject UserService interface, it works fine.
The interface UserService is annotated with @Service. The implementing class doesn't have any annotation as such.
Confused why this is happening?