users@glassfish.java.net

_at_Asynchronous EJB method not being invoked as such from a _at_PostConstruct

From: Noah White <emailnbw_at_gmail.com>
Date: Tue, 14 Aug 2012 17:56:50 -0400

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