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
}