Hi Alex,
I am not familiar with the APIs you are using so a simple working
maven-based example would help.
Are you just using the Jersey client API? and creating a Client from
within the run method? it could be that the stuff in META-INF/services
could not be loaded due to class loader restrictions. If you create
the Client outside the work object and pass it as a reference it might
work.
Note that Jersey does not currently does not support integration with
Servlet containers that suspend the connection, i am not sure if you
are utilizing that or not. We do however plan to support that, i just
need to discuss the details with Jean Francois who is developing
Atmosphere.
Paul.
On Aug 13, 2009, at 10:40 PM, Alex Sherwin wrote:
> Sorry, forwarding my own thread to Jersey mailing list as well...
> hoping to get a hit on an answer (this is also on glassfish mailing
> list)
>
>
> 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_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>