users@glassfish.java.net

_at_Startup _at_Singleton injection behavior question

From: Noah White <emailnbw_at_gmail.com>
Date: Tue, 5 Feb 2013 17:26:40 -0500

I have a @Startup @Singleton EJB which injects an @ApplicationScoped CDI bean which is used by the EJB's @PostConstruct method. It calls a getter on this @ApplicationScoped bean and is getting back NULL.

What's interesting is the object returned by the @ApplicationScoped bean's getter is constructed in its @PostConstruct method. It appears @PostConstruct is not being called in this case. The @ApplicationScoped bean itself does not inject any resources.

Is this a bug or by design? If by design could you point me to the spec reference? Thanks,

-Noah

Environment is gf: 3.1.2 b23