java.lang.IllegalStateException: Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?

Spring JIRA | Hugh Hamill | 1 year ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Using Springfox to document jax-rs services in a Spring app

    Stack Overflow | 2 years ago | Don Branson
    java.lang.IllegalStateException: Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Error while Implementing HATEOAS in Spring

    Stack Overflow | 3 years ago | Sunil Ks
    java.lang.IllegalStateException: Could not find current request via RequestContextHolder
  4. 0

    ControllerLinkBuilder.linkTo throws error if called outside of the context of a HTTP request

    GitHub | 2 years ago | nickgrealy
    java.lang.IllegalStateException: Could not find current request via RequestContextHolder

  1. iferca 9 times, last 4 months ago
  2. tvrmsmith 2 times, last 2 weeks ago
  3. Dunmer 1 times, last 1 month ago
  4. SteVio1989 8 times, last 3 months ago
  5. jpvee 2 times, last 4 months ago
3 more registered users
49 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?

    at org.springframework.util.Assert.state()
  2. Spring Core
    Assert.state
    1. org.springframework.util.Assert.state(Assert.java:392)[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    1 frame
  3. Spring Hateoas
    ControllerLinkBuilder.linkTo
    1. org.springframework.hateoas.mvc.ControllerLinkBuilder.getCurrentRequest(ControllerLinkBuilder.java:242)[spring-hateoas-0.19.0.RELEASE.jar:na]
    2. org.springframework.hateoas.mvc.ControllerLinkBuilder.getBuilder(ControllerLinkBuilder.java:189)[spring-hateoas-0.19.0.RELEASE.jar:na]
    3. org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:121)[spring-hateoas-0.19.0.RELEASE.jar:na]
    4. org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo(ControllerLinkBuilder.java:138)[spring-hateoas-0.19.0.RELEASE.jar:na]
    4 frames