users@glassfish.java.net

Re: CDI Instances and EJB and Glassfish

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Jul 2010 08:58:51 PDT

OK, this is either a specification gray area or a Glassfish bug. I kind of suspect the latter.

Iterating over the Instance<DAO> works fine when I move the whole apparatus into a class loaded by a .war file.

That is, now the class-in-the-war-file has this:
[code]
@Inject
private Instance<DAO> daos;
[/code]

...and it works fine (the jar file containing the DAO interface and the EJB jar file containing the Sessions EJB implementation are in the lib directory and the root of the containing ear file, respectively).

So it would seem there is something funky going on with classloaders and an ear file. I will attempt to isolate this and file a CDI bug.

Harald, thanks for your help.

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

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