1 Reply Latest reply on May 11, 2007 9:24 AM by stu2

    SessionContext injection throws NullPointerException

    milli

      Hi,

      I have a problem injecting sessionContext in to a util class. However it works in session scoped(haven't tried other scopes) seam component.

      For example:

      It works here:

      @Name("seamComp")
      @Scope(SESSION)
      public Class SeamComp
      {
      @In private Context sessionContext;
      
      .....
      
      }

      But it does not work if have a util class like this: It throws NullPointerException

      public Class SessionManager
      {
      @In private Context sessionContext;
      
      .....
      }


      Or even if tried to pass sessionContext from seamComp to a SessionManager method as a parameter, it throws NullPointerException inside SessionManager.
      I also tried Contexts.getSessionContext() instead of injection and it is the same behaviour.

      I can't understand why and I would appreicate any help.

      Thanks a lot