-
1. Re: How to make sure the web application is invoked after singletons are initialized?
jaikiran Jan 6, 2011 1:31 PM (in response to luis.planella)When the web app is started, it looks up EJBs.
Why not inject them? That way, the appropriate dependencies will be setup internally.
-
2. Re: How to make sure the web application is invoked after singletons are initialized?
luis.planella Jan 6, 2011 1:38 PM (in response to jaikiran)jaikiran pai wrote:
When the web app is started, it looks up EJBs.
Why not inject them? That way, the appropriate dependencies will be setup internally.
as we plan to easily deploy either everything as a single web app with EJBs (3.1) or split into a separate web using remote EJB interfaces, we cannot inject them, because the web application could run in a separate web server...
-
3. Re: How to make sure the web application is invoked after singletons are initialized?
jaikiran Jan 6, 2011 1:40 PM (in response to luis.planella)Where exactly are you doing these lookups? In the init()? The problem with (random) lookups in such lifecycle methods is that there's no way to setup the correct dependencies internally. You can however, setup the dependencies yourself through jboss-web.xml. But then again, if those beans aren't in the same server, then that won't work out either.
-
4. Re: How to make sure the web application is invoked after singletons are initialized?
luis.planella Jan 7, 2011 11:31 AM (in response to jaikiran)The lookups are done in a servlet context listener.
I've managed to fix the issue by lazily doing the lookups, as the beans themselves were invoked only on requests.
Thanks anyway.