Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-7983

@ExceptionHandler complains about unsupported argument for argument that is supported

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.1 M1
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      Works with 3.0.5.RELEASE.

      Method:

      @ResponseStatus(BAD_REQUEST)
      @ExceptionHandler(

      { ConstraintViolationException.class }

      )
      public void badRequest(final ConstraintViolationException e, final HttpServletResponse response) throws IOException {}

      Exception:

      java.lang.IllegalStateException: Unsupported argument [javax.validation.ConstraintViolationException] for @ExceptionHandler method: public void se.lantmateriet.dominium.web.ChangeTransactionController.badRequest(javax.validation.ConstraintViolationException,javax.servlet.http.HttpServletResponse) throws java.io.IOException
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.resolveHandlerArguments(AnnotationMethodHandlerExceptionResolver.java:264)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.doResolveException(AnnotationMethodHandlerExceptionResolver.java:135)
      at org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:136)
      at org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:987)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:811)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                magnus Magnus Heino
                Last updater:
                Trevor Marshall
              • Votes:
                3 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 14 weeks, 5 days ago