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 CDI injection across jars 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 "CDI injection across jars" Watch "CDI injection across jars" New topic
Author

CDI injection across jars

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
I have a jar which contains some @Named beans and I would like to inject from my war project in to them. I am using NB / Glassfish / Weld. I have moved the class in to the jar and it works fine, however, when it exists in my webapp it doesn't. My webapp has a beans.xml file in the META-INF directory (I have tried it there and in the WEB-INF) and I have verified that CDI is enabled on it.

Example

in api.jar:


in my war:


Seems like it should work, but it doesn't. Again, it works when MyConfig class is added to the api.jar

Thanks for any help.


http://www.goodercode.com
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CDI injection across jars
 
Similar Threads
Problem getting Bean reference which is in jar from JSP
confused between jar and war files
Access EJB out of WAR in JBoss 6
Servlet mapping not working after upgrading to Tomcat 6 from Tomcat 5
NullPointer when working with Events in CDI