users@glassfish.java.net

Re: Using a WorkManager causes the thread execution context/classloader to change?

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Mon, 17 Aug 2009 10:07:21 +0530

Are you using com/sun/enterprise/connectors/work/WorkManagerFactory ?
This is meant to be used only by connectors (resource-adapters).

Can you post the configuration of default thread pool ?

Thanks,
-Jagadish






On Thu, 2009-08-13 at 13:34 -0400, Alex Sherwin wrote:
> I've setup a WorkManager using the glassfish WorkManagerFactory class
> (using the default thread pool). I'm attempting to use it to perform
> asynchronous HTTP requests using the Jersey lib (along with apache
> commons httpclient for basic/authentication purposes).
>
> However, it appears as though when the WorkManager invokes the run()
> method of the Work Object that the the execution context is different
> then that of the application which scheduled the work. Jersey is
> failing to find MessageBodyWriters and Readers, along with numerous
> other issues associated with it... Is there any way to prevent this?
>
> If I implement the same idea using ExecutorService with default
> ThreadFactory, everything works as I would expect it to using the
> WorkManager. However, I'd have to believe that running within the app
> server it would be better to use the WorkManager to do this, so that it
> utilizes threads from defined/configurable thread pools.
>
> Is there something I'm doing wrong, or some other way of accomplishing this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>