java.lang.IllegalStateException: Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete

Spring JIRA | Maxim Valyanskiy | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Sometimes our tests fails with following exceptions: {code} java.lang.IllegalStateException: Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete at org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:133) at org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:121) at org.springframework.test.web.servlet.result.RequestResultMatchers$3.match(RequestResultMatchers.java:94) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:149) at SimpleControllerTest.testSimple(SimpleControllerTest.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) {code} I reproduced this problem in sample application. Complete application is available at https://github.com/maxcom/spring-test-bug.

    Spring JIRA | 3 years ago | Maxim Valyanskiy
    java.lang.IllegalStateException: Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete
  2. 0

    Sometimes our tests fails with following exceptions: {code} java.lang.IllegalStateException: Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete at org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:133) at org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:121) at org.springframework.test.web.servlet.result.RequestResultMatchers$3.match(RequestResultMatchers.java:94) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:149) at SimpleControllerTest.testSimple(SimpleControllerTest.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) {code} I reproduced this problem in sample application. Complete application is available at https://github.com/maxcom/spring-test-bug.

    Spring JIRA | 3 years ago | Maxim Valyanskiy
    java.lang.IllegalStateException: Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete
  3. 0

    Spring DeferredResult timeout

    Stack Overflow | 7 months ago | marknorkin
    java.lang.IllegalStateException: Async result for handler [public org.springframework.web.context.request.async.DeferredResult<org.springframework.http.ResponseEntity<org.springframework.core.io.InputStreamResource>> com.example.controller.FileController.getSomeFile()] was not set during the specified timeToWait=9223372036854775807
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Gave up waiting on async result from handler [public org.springframework.web.context.request.async.DeferredResult<java.lang.String> SimpleController.handle()] to complete

      at org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult()
    2. Spring TestContext
      MockMvc$1.andExpect
      1. org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:133)
      2. org.springframework.test.web.servlet.DefaultMvcResult.getAsyncResult(DefaultMvcResult.java:121)
      3. org.springframework.test.web.servlet.result.RequestResultMatchers$3.match(RequestResultMatchers.java:94)
      4. org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:149)
      4 frames
    3. Unknown
      SimpleControllerTest.testSimple
      1. SimpleControllerTest.testSimple(SimpleControllerTest.java:35)
      1 frame
    4. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3 frames
    5. JUnit
      RunBefores.evaluate
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      5 frames