wood burning stoves*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Dependency injection and deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Dependency injection and deployment" Watch "Dependency injection and deployment" New topic
Author

Dependency injection and deployment

Kumar Amit
Ranch Hand

Joined: Aug 13, 2001
Posts: 103
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
xsunil kumar
Ranch Hand

Joined: Dec 14, 2009
Posts: 133
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.
Marcelo Ortego
Greenhorn

Joined: May 31, 2005
Posts: 9
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.
Kumar Amit
Ranch Hand

Joined: Aug 13, 2001
Posts: 103
Thanks guys. Since I am using DI and injecting SessionBean into JSF backing bean, thus I will keep both .war in the same .ear.
Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486
    
    2

Hi rancher
Reading this post I was thinking...I need to declare in my assignment How I'll be generated as the war + ejb jar's or ear?
The proposed solution is not a high level?

Regards


Fernando Franzini - Java Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dependency injection and deployment
 
Similar Threads
Need Help
Is backing Bean Replacing Command Pattern?
General design questions
new to EJB : EJB 3.0 queries
dependency injection on distributed containers