Re: RequestScoped and background threads

2017-06-13 Thread Stephan Classen
The request scope uses internally a thread local. So when you run stuff in a background thread you are not in a request as guice sees it. You need to call the same method as the mentioned filter does inorder to begin and end a request. Am 13. Juni 2017 20:21:00 MESZ schrieb Arun Thirupathi

RequestScoped and background threads

2017-06-13 Thread Arun Thirupathi
In one of our projects we are binding an implementation in RequestScope. But when this is run from a background thread, it fails with the exception below. Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP