• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dependency injection and deployment

 
Kumar Amit
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic