2 Replies Latest reply on Sep 30, 2006 10:16 AM by lowecg2004

    @LoggedIn kills injection in beans

    bfo81

      I have an abstract bean that encapsulates common functions (store, delete, etc.). It also contains some properties like the EntityManager or the Logger, which are injected. (If you wonder why I want abstract classes, then look at the DRY thread: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=86529)

      Concrete classes inherited all that stuff from that abstract superclass and were able to access those injected properties... until now. I added a @LoggedIn interceptor (from booking example) to the concrete class and now Seam injection does not work anymore. The injected properties from the abstract superclass as well as those from the concrete subclass are all null now. Only the EntityManager exists, but this one gets injected by EJB3, not by Seam.

      If I remove @LoggedIn everything is fine again.

      @Experts: Could you please have a look at the LoggedInInterceptor (from booking example) and tell me why it prevents injection in subclasses? I have absolutely no clue :(.

      btw: Even when inheriting from non-abstract superclasses Seam injection also doesn't work at all anymore.

        • 1. Re: @LoggedIn kills injection in beans
          mrohad

          same thing happen to me!any idea?

          • 2. Re: @LoggedIn kills injection in beans
            lowecg2004

            You've probably discovered this by now, but I thought I would respond just in case anyone else comes across this thread...

            Injection does not happen because the example LoggedInInterceptor is configured to be "around" the BijectionInterceptor.class

            @Interceptor(around = { BijectionInterceptor.class, ValidationInterceptor.class,
             ConversationInterceptor.class, BusinessProcessInterceptor.class
            }, within = RemoveInterceptor.class)
            public class LoggedInInterceptor {
            ...
            }


            Therefore the LoggedInInterceptor is invoked before the BijectionInterceptor class has worked its magic.