Hi, Using @ControllerAdvice annotation I want to handle Runtime exceptions globally in CustomExceptionHandler class. Below is an example
@ControllerAdvice
public class CustomExceptionHandler
{
@ExceptionHandler(CustomExceptionHandler.class)
public ModelAndView handleAllException(final Exception exception)
{
}
}
But this exception handler is not being called when application throws exception like null pointer. Please let me know If I am missing any configuration or I should change my approach. Thanks.