Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EJB injection from different jar

 
Mattia Battiston
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm having a problem with EJB injection, hopefully someone here will be able to help me.

I've got a jar with an EJB in there; this is its code:



From other classes in the same jar I can inject it simply like this:


Here comes the problems: I'm actually deploying this jar in an ear, and in this ear I've also got a war with some JSF pages and related java backing beans.
What I want to do is to inject my TravelAgentBean in a page's backing bean (e.g. CreateCabinBackingBean), but the same code as above doesn't work:


However, this code works:


I'm deploying on Jboss 4.2.2. I'm quite new both with JSF and EJB, so probably there's something I'm missing...can someone please give me an advice on how to make the dependency injection work?

Thank you very much
Mattia

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this JavaRanch post for why it doesn't work in JBoss for JSF.
 
Mattia Battiston
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, that's clear now, thank you very much. Mattia
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic