tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <>
Subject Re: Making use of the injection facility?
Date Thu, 07 May 2009 13:02:49 GMT
On Thu, May 7, 2009 at 3:07 AM, Jean-Louis MONTEIRO <> wrote:

> Even if it's not part of the specification, I'm quite sure it would help
> end
> users.
> Any thoughts ?

The main issue I'm having is that the @EJB annotation wants to get
everything from the ENC, which, to my poor muddling brain, looks like it
isn't built when you're using a local server.  (The ENC is the
"java:comp/env" part.)  That makes a certain amount of sense, since a unit
test is neither itself an EJB, a web module nor an application client

So a fully-functioning @EJB(name="foo") annotation, for example, will
attempt to look up a remote business interface from "java:comp/env/foo".
But all the EJBs are actually bound in the root context.

I've attempted to set the openejb.jndiname.format property, or whatever it
is, to "java:comp/env/{ejbName}" (typed from memory; might have made a
mistake) but although EJBs are then bound under that name they aren't
found--I didn't really expect that they would be.

Lastly in a fit of insanity I attempted to make the OpenEJB runner a
sniffable application client--I gave it a main method, a Main-Class entry in
its MANIFEST.MF, etc.--but OpenEJB didn't pick it up in the classpath--I was
thinking i could then perform injection somehow into *it* and then transfer
the results to the class under test...needless to say that came to naught.

So I am beginning to see the wisdom of Jonathan Gallimore's "just good
enough" injection hacking, and may fall back on it, unless David or someone
familiar with the ENC internals can chime in.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message