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 Servlet request, or you may have forgotten to apply
com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
Can I bind different implementations based on the scope ? I want to provide one implementation in RequestScope and other implementation in another scope.
Is there a way to configure Guice to ignore these errors silently.
Currently I am thinking of the naive way of, try/catch all the usage of this object, which is far too many and there are new interactions with this object.
I run my project inside Google App Engine, if that matters.
Thanks,
Arun.