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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

If you're using boot 1.4.x you need to modify the @springBootTest annotation to @SpringBootTest(classes = DataFlowServerConfiguration.class). 1.3.8 doesn't have this problem as well.

,
Expert tip

Spring Boot 1.4 changed their annotation system a little. Try using the @SpringBootApplication annotation for better results.

Solutions on the web

via GitHub by nickgrealy
, 1 year ago
via Stack Overflow by Romell
, 1 year ago
Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?
via Stack Overflow by Don Branson
, 1 year ago
Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?
via Stack Overflow by Adrian Reyes
, 1 year ago
java.lang.IllegalStateException: Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler?
at org.springframework.hateoas.mvc.ControllerLinkBuilder.getCurrentRequest(ControllerLinkBuilder.java:242)
at org.springframework.hateoas.mvc.ControllerLinkBuilder.getBuilder(ControllerLinkBuilder.java:189)
at org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:121)

Users with the same issue

36 times, 6 hours ago
5 times, 2 weeks ago
7 times, 1 month ago
Once, 1 month ago
2 times, 1 month ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.