users@glassfish.java.net

Re: CDI Instances and EJB and Glassfish

From: <glassfish_at_javadesktop.org>
Date: Sun, 18 Jul 2010 21:02:58 PDT

You mention ear packaging--in point of fact my example is slightly more complicated. There's one more level of indirection involved. I have a class that has injected into it an instance of DAOFinder. DAOFinder, in turn, is the one that has Instance<DAO> injected into it.

Now, the class into which DAOFinder is injected is present in a war file inside my ear. The DAOFinder itself--the class that actually has the Instance<DAO> injected into it--is a member of just another jar file (with a META-INF/beans.xml, of course) in the lib directory. DAO is a member of another jar in the lib directory as well.

Am I doing something illegal here? Should the jar that has the DAO interface have a beans.xml as well (even though it's pretty much an interfaces-only jar file)? Is there something odd or against the grain involving one lib-housed jar file trying to inject stuff from another lib-housed jar file inside an ear?

I want to whittle down the obvious mistakes before I spend the next week-plus trying to figure this out.

Thanks for all the help so far.

Best,
Laird
[Message sent by forum member 'ljnelson']

http://forums.java.net/jive/thread.jspa?messageID=477924