This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

ThreadPoolExecutor within an action component

Dec 10th, 2010, 03:25 PM

Hi folks,

I am trying to run a callable thread using a ScheduledThreadPoolExecutor within a MultiAction component where the callable is submitted in one flow, and retrieved in a later flow. The callable is using a DAO which is session scoped.

/*TODO: this exception is being generated in subsequent get().
* java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.firmDao': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
*/
public class FirmAcquire implements Callable<List<Adapter>> {
private ComponentClientDao<Adapter> myDao;

So, to the question; what is causing this exception? I had thought that the Dao was already inserted into the proxy on instantiation of the action. Can someone step me through the lifecycle event which is causing this?