1 Reply Latest reply on Nov 26, 2009 11:25 PM by Shervin Asgari

    Annotation @Context leaves field null

    Wim Van Leuven Newbie

      I've been struggling for days now to get a proper project setup for my developemnt using Seam, Rest, Hibernate, JBoss Tools, JBoss (Maven was preferred, but left for now). Basics first ;-)

      I got almost everything running now, except for the @Context injections on fields for e.g. UriInfo objects.They always remain null. I know I could annotate it on the methods, but I'd prefer them as fields.

      Am I overlooking some configuration?

      Any help would be greatly appreciated.

        • 1. Re: Annotation @Context leaves field null
          Shervin Asgari Master

          I haven't used @Context, so my guess is you are using that annotation wrong. What do you actually want to do? Injections in Seam is used by the @In annotation, not @Context.

          If you have something in the different contexts, you can always get it like Contexts.getCoversationContext().get("nameOfComponent")
          Note that I might have a typo here since I just wrote from my memory.