File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes @EJB injection from different jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "@EJB injection from different jar" Watch "@EJB injection from different jar" New topic
Author

@EJB injection from different jar

Mattia Battiston
Greenhorn

Joined: Mar 23, 2009
Posts: 7
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

Joined: May 26, 2003
Posts: 31076
    
233

See this JavaRanch post for why it doesn't work in JBoss for JSF.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Mattia Battiston
Greenhorn

Joined: Mar 23, 2009
Posts: 7
ok, that's clear now, thank you very much. Mattia
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @EJB injection from different jar