Spring Framework
  1. Spring Framework
  2. SPR-7983

@ExceptionHandler complains about unsupported argument for argument that is supported

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor 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)

        Issue Links

          Activity

          Hide
          Magnus Heino added a comment -

          My problems were resolved with the final release of Spring 3.1.0

          Show
          Magnus Heino added a comment - My problems were resolved with the final release of Spring 3.1.0
          Hide
          Chris Beams added a comment -

          Rossen, please resolve if appropriate.

          Show
          Chris Beams added a comment - Rossen, please resolve if appropriate.
          Hide
          Morten Andersen-Gott added a comment -

          Added SPR-9138 to address the issue of System.currentTimeMillis() being executed as a exceptionHandler-method. Not sure they are related.

          Show
          Morten Andersen-Gott added a comment - Added SPR-9138 to address the issue of System.currentTimeMillis() being executed as a exceptionHandler-method. Not sure they are related.
          Hide
          Morten Andersen-Gott added a comment -

          Still experiencing this issue with 3.1.0.RELEASE

          Show
          Morten Andersen-Gott added a comment - Still experiencing this issue with 3.1.0.RELEASE
          Hide
          Rossen Stoyanchev added a comment -

          Given Mangus' report that the issue is resolved in 3.1 GA and to avoid making this ticket very long, I am resolving it.

          @Morten, please open a new ticket and describe the issue you see in detail. Better yet, for faster resolution consider demonstrating the issue in the issue repository.

          Show
          Rossen Stoyanchev added a comment - Given Mangus' report that the issue is resolved in 3.1 GA and to avoid making this ticket very long, I am resolving it. @Morten, please open a new ticket and describe the issue you see in detail. Better yet, for faster resolution consider demonstrating the issue in the issue repository .

            People

            • Assignee:
              Rossen Stoyanchev
              Reporter:
              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:
                2 years, 9 weeks, 2 days ago