users@glassfish.java.net

Re: _at_Asynchronous EJB method not being invoked as such from a _at_PostConstruct

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Tue, 14 Aug 2012 15:19:05 -0700

Do you call it directly or through a proxy ref? It should go through the
EJB container to become async.

-marina

Noah White wrote:
> I have a @Singleton @Startup no-interface EJB deployed in GF 3.1.2.
>
> It's @PostConstruct method calls a method in on the same bean which is annotated with @Asynchronous.
>
> That async method calls SessionContext.wasCancelCalled().
>
> When wasCancelCalled() is called it throws a java.lang.IllegalStateException: Must be invoked from an async method.
>
> The spec states that Singleton beans support reentrant calls.
>
> Why does it not see this as the async method that it is? Can someone shed some light on this?
>
> Thanks,
>
> -Noah
>
>