[jboss-dev-forums] [JBoss AS7 Development] - Re: @EJB(lookup) fails while context.lookup() is successfull
Jason Greene
do-not-reply at jboss.com
Mon Oct 24 16:05:17 EDT 2011
Jason Greene [http://community.jboss.org/people/jason.greene] created the discussion
"Re: @EJB(lookup) fails while context.lookup() is successfull"
To view the discussion, visit: http://community.jboss.org/message/633377#633377
--------------------------------------------------------------
> Dan Sirbu wrote:
>
> No - they are not EE components. They are plain java classes:
>
> public class MyTestClass{
> ...
> @EJB or @EJB(lookup) or @EJB(mappedName) - does not work - jndi lookup yes
> private ILcExample lc;
>
> ......
> }
>
Ok yeah, then as I mentioned above, per spec those classes are not elligible for injection (only EE components). The JNDI look up works because the classes are sharing the EE context of the component that calls them.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/633377#633377]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111024/e0837caa/attachment.html
More information about the jboss-dev-forums
mailing list