@Autowire failing with @Repository
I am not being able to make @Autowire annotation work with a @Repository annotated class. I have an interface: public interface AccountRepository { public Account findByUsername(String username); public Account findById(long id); public Account save(Account account); } And the class implementing the interface annotated with @Repository : @Repository public class AccountRepositoryImpl implements AccountRepository { public Account findByUsername(String username){ //Implementing code } public Account findById(long id){ //Implementing code } public Account save(Account account){ //Implementing