I work on spring boot 2 project and define the following code, but the messageSource always is null. I have autowired MessageSource in @service class, it works. Who can tell me WHY?
public class ApplicationException extends RuntimeException {
private static final long serialVersionUID = 1L;
@Autowired
private MessageSource messageSource;
}