users@glassfish.java.net

Re: _at_Startup _at_Singleton injection behavior question

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Tue, 05 Feb 2013 14:37:01 -0800

May be PostConstruct interceptor is not enabled for the CDI bean?

-marina
On 2/5/13 2:26 PM, Noah White wrote:
> 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