users@jersey.java.net

[Jersey] Re: Problems with AsyncResponse in GF 4

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 22 Oct 2012 14:51:14 +0200

Hi Jan,
it's quite likely a bug. Can you please file a Jira issue? In case you have a reproducible test/application, could you please attach it to the issue?

Thanks,
Marek

On Oct 20, 2012, at 10:45 AM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:

> Hi,
>
> I am trying out Jersey 2 in Glassfish 4 (b58) and experience some problems.
>
> The first of the methods below works as expected, the second invokes an
> EJB's asynchronous getSlow() method and crashes right after the 'Enter async2' log.
>
> Am I doing anything wrong or could that be a bug?
>
>
> @GET
> @Path("async1")
> @Asynchronous
> public void getAsync1(@Suspended AsyncResponse ar) {
> LOG.info("Enter async1");
> ar.resume("Async1 - OK");
> LOG.info("Exit async1");
> }
>
> @GET
> @Path("async2")
> public void getAsync2(@Suspended AsyncResponse ar) {
> LOG.info("Enter async2");
> test.getSlow(ar);
> LOG.info("Exit async2");
> }
>
> ---------------------------------------------
>
> @Stateless
> public class Test {
> private static Logger LOG = Logger.getLogger(Test.class.getName());
> @Asynchronous
> @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) // Tried with and without the 'new tx'
> public void getSlow(AsyncResponse ar) {
> LOG.info("Enter");
> ar.resume("Async2 - OK");
> LOG.info("Exit");
> }
> }
>
>
> Jan
>