1 Reply Latest reply on Feb 11, 2010 10:20 AM by Nikos Paraskevopoulos

    question about static objects and injection

    Dan Dosch Newbie

      Can anyone explain why this doesn't work? Can static objects not be injected or is it the create true part that is making it not work?


      @Name("test")
      @Scope(ScopeType.APPLICATION)
      public class Test {
              @In(create=true)
              private static TestObject testObj;
              
              public static void doSomething() {
                      testObj.doSomethingElse(); // testObj is null at runtime
              }
      }