openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars-Fredrik Smedberg <>
Subject Design - CDI and worker threads
Date Thu, 10 Apr 2014 13:37:24 GMT

If I within a thread wishes to start asynchronous "jobs" using the
ExecutorService (and Executors.newFixedThreadPool(...)) and wait for the
Future-result within that same thread I run into the following exception:

"WebBeans context with scope type annotation @RequestScoped does not exist
within current thread"

which is understandable since the managed bean passed used in the Callable
passed to ExecutorService.submit(...) contains injected beans iteself that
are @RequestScoped.

Is there any way around this? Suggestions on changing the design perhaps?

Lars-Fredrik Smedberg

Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at, and destroy all copies of this
message and any attachments.

View raw message