I have the following simple controller to catch any unexpected exceptions:
@ControllerAdvice public class ExceptionController { @ExceptionHandler(Throwa
This is better:
((HandlerExceptionResolverComposite) wac.getBean("handlerExceptionResolver")).getExceptionResolvers().get(0)
And do not forget to scan for @ControllerAdvice beans in your @Configuration class:
@ComponentScan(basePackages = {"com.company.exception"})
...tested on Spring 4.0.2.RELEASE