I am using dependency injection by the container and injecting SessionBean into my JSF backing beans. Will this work if I deploy web application (.war containing JSF stuff) on a separate web server and .ear containing session beans on a separate application server?
SCJP, SCJD, SCEA
Joined: Dec 14, 2009
Amit, as per my understanding it will not work. if DI releated code has been deployed as an EAR and you are trying to pull that value in web application ( assuming webapplication is not a part of EAR), it will not work. Instead you can try using JNDI lookup.
Joined: May 31, 2005
I agree with Xsunil. This is my understanding also. If the .ear contains the .war, then DI will work. Otherwise you will need to perform context lookups.
If anyone can prove the contrary, please do.
Joined: Aug 13, 2001
Thanks guys. Since I am using DI and injecting SessionBean into JSF backing bean, thus I will keep both .war in the same .ear.