-
1. Re: Event with qualifier @Initialized not fired if no webapp is deployed
daniell Feb 26, 2014 3:18 AM (in response to daniell)The CDI-specification says the following (section 6.7.3. Application context lifecycle):
An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired when the application is destroyed.
So I guess this is a bug, isn't it?
-
2. Re: Event with qualifier @Initialized not fired if no webapp is deployed
mkouba Feb 26, 2014 4:52 AM (in response to daniell)Hi Daniel,
yes, it seems it's a bug. Could you file a new issue (Weld - JBoss Issue Tracker)? Actually this is not clearly defined in the spec. There are some @ApplicationScoped and visibility related issues, e.g. CDI-129, CDI-265 and CDI-405.
Martin
-
3. Re: Event with qualifier @Initialized not fired if no webapp is deployed
mkouba Feb 26, 2014 4:55 AM (in response to daniell)Also you could try @ApplicationScoped Singleton session bean with @Startup annotation instead...
-
4. Re: Event with qualifier @Initialized not fired if no webapp is deployed
daniell Feb 26, 2014 5:17 AM (in response to mkouba)Hi Martin
Thanks for your reply. I will create an JIRA issue shortly.
I was already thinking about your proposed alternative, but I was happy to find the solution using the @Initialized-annotation since the initialization-class is not located in an EJB-module but a plain JAR (which goes into the lib subdirectory of the EAR). But as workaround I think I'll have to create a session bean.