users@glassfish.java.net

Re: GF 3.0.1 Bug: JavaMail Rsource Injection fails but JNDI lookup works!

From: <glassfish_at_javadesktop.org>
Date: Fri, 08 Oct 2010 19:37:26 PDT

The injection target class needs to be managed by Java EE servers [b]at runtime[/b], not by structs. Where is this ContactAction in the call stack at request time? I suspect it's instantiated and managed by structs runtime, instead of by web container. If so, then there is another instance of it that's instantiated by Java EE container with all the injections performed, but remains idle at runtime.

You can try to invoke this ManagedBean directly from your servlet or any other web components, and see if injection in ContactAction works. For example,

@Resource
private ContactAction ca;

ca.getMailSession();
[Message sent by forum member 'cf126330']

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