3 Replies Latest reply on Dec 2, 2005 4:54 AM by luke biddell

    @Resource injection not working

    luke biddell Newbie

      I'm trying to use resource injection and am not having any success. I'm very new to EJB3 and EJB in general so my apologies if i've missed reading some docco somewhere.

      I want to inject the SessionContext into a Stateless session bean. I've tried it under both 4.0.3 and 4.0.3sp1.

      The code is like this:

      public final class TestBean implements Test {
      @Resource private SessionContext ctx;

      public void doSomething() {
      // ctx is null here??????

      I thought that cts would be injected and I would be able to use the SessionContext.

      Can anyone help?