From a286b095735b78332c639458a0c8a109e2460282 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Wed, 14 Feb 2018 10:49:16 +0100 Subject: [PATCH] SPR-16496 - Exception handler class lookup fix --- .../method/annotation/ExceptionHandlerExceptionResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java index 447696415848..583fad17b063 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java @@ -444,7 +444,7 @@ protected ModelAndView doResolveHandlerMethodException(HttpServletRequest reques */ @Nullable protected ServletInvocableHandlerMethod getExceptionHandlerMethod(@Nullable HandlerMethod handlerMethod, Exception exception) { - Class handlerType = (handlerMethod != null ? handlerMethod.getBeanType() : null); + Class handlerType = (handlerMethod != null ? handlerMethod.getMethod().getDeclaringClass() : null); if (handlerMethod != null) { ExceptionHandlerMethodResolver resolver = this.exceptionHandlerCache.get(handlerType);