I have a basic API setup with Spring MVC Rest as following.

```
public abstract class AbstractApi implements InitializingBean {

    @Autowired
    protected ValidatorFactory validatorFactory;

    /* ... */

    @Override
    public void afterPropertiesSet() throws Exception {
        Assert.notNull(validatorFactory);
    }
}

@Controller
@RequestMapping("books")
public class BookApi extends AbstractApi {

    private final BookRepository bookRepository;

    @Autowired
    public BookApi(BookRepository bookRepository) {
        this.bookRepository = bookRepository;
    }

    @RequestMapping(method = RequestMethod.GET)
    public ResponseEntity<Book> getBooks() {
        return new ResponseEntity<>(bookRepository.findAll(), HttpStatus.OK);
    }
}

```

The server returns `404 - Not Found` if I send `GET /books` request with above configuration.

But, if I make `AbstractApi` un-implement `InitializingBean`, it works fine. Also, annotating `@PostConstruct` to `afterPropertiesSet()` instead of implementing `InitializingBean` works.

Why is Spring `@Controller` API not working when implementing `InitializingBean`?