java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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)
    via by Magnus Heino,
  • 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)
    via by Magnus Heino,
  • SimpleFormController Issue in Java
    via Stack Overflow by Venkat
    ,
  • Opening this issue as a response to Rossen's comment in SPR-7983: We keep seeing exceptions in the logs seemingly caused by the AnnoationMethodHandlerExceptionResolver. Here's a snapshot from the logs {code} [DEBUG] [2012.02.27 11:15:19] (T0tXt1BbKEcAAD4WCUcAAAAP) Resolving exception from handler [com.mycompany.FooController@36be9ce9]: java.lang.NullPointerException [] at org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:132) [ERROR] [2012.02.27 11:15:19] (T0tXt1BbKEcAAD4WCUcAAAAP) Invoking request method resulted in exception : public java.lang.String com.mycompany.AbstractFooController.handleMissingRequestParameterException(org.springframework.web.bind.MissingServletRequestParameterException,javax.servlet.http.HttpServletRequest) [] at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.doResolveException(AnnotationMethodHandlerExceptionResolver.java:143) java.lang.IllegalStateException: Unsupported argument [org.springframework.web.bind.MissingServletRequestParameterException] for @ExceptionHandler method: public java.lang.String com.mycompany.AbstractFooController.handleMissingRequestParameterException(org.springframework.web.bind.MissingServletRequestParameterException,javax.servlet.http.HttpServletRequest) 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:1120) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:944) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) {code} The first debug statement is from the same request as the next log statement (the ERROR). So, a NPE is the cause. We have a @ExceptionHandler method specified to handle MissingServletRequestParameterException. This should not be invoked, but seems to be invoked for some reason. The ERROR-log statement is saying that XX is a Unsupported argument for a method taking XX. There seem to be something seriously wrong with the matching algorithme. I haven't been able to pin-point what it is though, as I haven't been able to reproduce in a controlled environment (it is typically seen between 1 and 10 times each day in the production logs). This fact alone makes me suspect that it stems from a concurrency issue, one has already been identified in SPR-9138
    via by Morten Andersen-Gott,
  • Opening this issue as a response to Rossen's comment in SPR-7983: We keep seeing exceptions in the logs seemingly caused by the AnnoationMethodHandlerExceptionResolver. Here's a snapshot from the logs {code} [DEBUG] [2012.02.27 11:15:19] (T0tXt1BbKEcAAD4WCUcAAAAP) Resolving exception from handler [com.mycompany.FooController@36be9ce9]: java.lang.NullPointerException [] at org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:132) [ERROR] [2012.02.27 11:15:19] (T0tXt1BbKEcAAD4WCUcAAAAP) Invoking request method resulted in exception : public java.lang.String com.mycompany.AbstractFooController.handleMissingRequestParameterException(org.springframework.web.bind.MissingServletRequestParameterException,javax.servlet.http.HttpServletRequest) [] at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.doResolveException(AnnotationMethodHandlerExceptionResolver.java:143) java.lang.IllegalStateException: Unsupported argument [org.springframework.web.bind.MissingServletRequestParameterException] for @ExceptionHandler method: public java.lang.String com.mycompany.AbstractFooController.handleMissingRequestParameterException(org.springframework.web.bind.MissingServletRequestParameterException,javax.servlet.http.HttpServletRequest) 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:1120) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:944) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) {code} The first debug statement is from the same request as the next log statement (the ERROR). So, a NPE is the cause. We have a @ExceptionHandler method specified to handle MissingServletRequestParameterException. This should not be invoked, but seems to be invoked for some reason. The ERROR-log statement is saying that XX is a Unsupported argument for a method taking XX. There seem to be something seriously wrong with the matching algorithme. I haven't been able to pin-point what it is though, as I haven't been able to reproduce in a controlled environment (it is typically seen between 1 and 10 times each day in the production logs). This fact alone makes me suspect that it stems from a concurrency issue, one has already been identified in SPR-9138
    via by Morten Andersen-Gott,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,