79380061

Date: 2025-01-23 06:49:15
Score: 1.5
Natty:
Report link

The error Scope 'request' is not active for the current thread typically occurs when you try to access a Spring bean with request scope outside the context of an active HTTP request. This often happens when a @RequestScope or @SessionScope bean is accessed from a singleton bean (like a @Service or @Component) that operates outside of a web request thread.

@Component
@RequestScope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class TenantContext {
    // Your bean definition
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @RequestScope
  • User mentioned (0): @SessionScope
  • User mentioned (0): @Service
  • User mentioned (0): @Component
  • Low reputation (1):
Posted by: Khaja Shekh