org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

GitHub | markward-schubert | 2 months ago
  1. 0

    Scoped Beans cause error with spock-spring 1.1-groovy-2.4-rc-2

    GitHub | 2 months ago | markward-schubert
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
  2. 0

    Scope 'request' is not active for the current thread - websocket edition

    Stack Overflow | 10 months ago | amrnablus
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.notificationController': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
  3. 0

    Spring MVC: How to use a request-scoped bean inside a spawned thread?

    Stack Overflow | 4 years ago | Abdull
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.facebook': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring deferred result & request scoped bean(Oauth2ClientContext) in the web filter

    Stack Overflow | 2 years ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
  6. 0

    Spring MVC: How to use a request-scoped bean inside a spawned thread?

    codedmi.com | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.facebook': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

  1. Andreas Häber 1 times, last 1 month ago
9 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

    No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

    at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes()
  2. Spring
    AbstractRequestAttributesScope.get
    1. org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    2. org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:41)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    2 frames
  3. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    2. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    2 frames
  4. Spring Context
    AbstractApplicationContext.getBean
    1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    1 frame
  5. org.spockframework.spring
    SpringMockTestExecutionListener.beforeTestMethod
    1. org.spockframework.spring.SpringMockTestExecutionListener.beforeTestMethod(SpringMockTestExecutionListener.java:49)[spock-spring-1.1-groovy-2.4-rc-2.jar:na]
    1 frame
  6. Spring TestContext
    TestContextManager.beforeTestMethod
    1. org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:269)[spring-test-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    1 frame
  7. org.spockframework.spring
    SpringInterceptor.interceptSetupMethod
    1. org.spockframework.spring.SpringTestContextManager.beforeTestMethod(SpringTestContextManager.java:54)[spock-spring-1.1-groovy-2.4-rc-2.jar:na]
    2. org.spockframework.spring.SpringInterceptor.interceptSetupMethod(SpringInterceptor.java:45)[spock-spring-1.1-groovy-2.4-rc-2.jar:na]
    2 frames
  8. Spock Framework - Core Module
    Sputnik.run
    1. org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:28)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    2. org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:87)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    3. org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:472)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    4. org.spockframework.runtime.BaseSpecRunner.runSetup(BaseSpecRunner.java:375)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    5. org.spockframework.runtime.BaseSpecRunner.runSetup(BaseSpecRunner.java:370)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    6. org.spockframework.runtime.BaseSpecRunner.doRunIteration(BaseSpecRunner.java:323)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    7. org.spockframework.runtime.BaseSpecRunner$6.invoke(BaseSpecRunner.java:309)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    8. org.spockframework.runtime.BaseSpecRunner.invokeRaw(BaseSpecRunner.java:481)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    9. org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:464)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    10. org.spockframework.runtime.BaseSpecRunner.runIteration(BaseSpecRunner.java:288)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    11. org.spockframework.runtime.BaseSpecRunner.initializeAndRunIteration(BaseSpecRunner.java:278)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    12. org.spockframework.runtime.BaseSpecRunner.runSimpleFeature(BaseSpecRunner.java:269)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    13. org.spockframework.runtime.BaseSpecRunner.doRunFeature(BaseSpecRunner.java:263)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    14. org.spockframework.runtime.BaseSpecRunner$5.invoke(BaseSpecRunner.java:246)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    15. org.spockframework.runtime.BaseSpecRunner.invokeRaw(BaseSpecRunner.java:481)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    16. org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:464)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    17. org.spockframework.runtime.BaseSpecRunner.runFeature(BaseSpecRunner.java:238)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    18. org.spockframework.runtime.BaseSpecRunner.runFeatures(BaseSpecRunner.java:188)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    19. org.spockframework.runtime.BaseSpecRunner.doRunSpec(BaseSpecRunner.java:98)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    20. org.spockframework.runtime.BaseSpecRunner$1.invoke(BaseSpecRunner.java:84)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    21. org.spockframework.runtime.BaseSpecRunner.invokeRaw(BaseSpecRunner.java:481)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    22. org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:464)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    23. org.spockframework.runtime.BaseSpecRunner.runSpec(BaseSpecRunner.java:76)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    24. org.spockframework.runtime.BaseSpecRunner.run(BaseSpecRunner.java:67)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    25. org.spockframework.runtime.Sputnik.run(Sputnik.java:63)[spock-core-1.1-groovy-2.4-rc-2.jar:na]
    25 frames
  9. JUnit
    JUnitCore.run
    1. org.junit.runner.JUnitCore.run(JUnitCore.java:137)[junit-4.12.jar:4.12]
    1 frame
  10. IntelliJ junit4 module
    JUnit4IdeaTestRunner.startRunnerWithArgs
    1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)[junit-rt.jar:na]
    2. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)[junit-rt.jar:na]
    2 frames
  11. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)[junit-rt.jar:na]
    2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)[junit-rt.jar:na]
    2 frames
  12. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_51]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_51]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_51]
    4. java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_51]
    4 frames
  13. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)[idea_rt.jar:na]
    1 frame