8 Replies Latest reply on Mar 9, 2010 12:01 PM by pmuir

    Injection into EJB interceptors and custom JSF ExceptionHandler classes

    hirowla.ian.rowlands.three.com.au

      Has anybody tried doing this and succeeded?


      I have a @Interceptor around my EJB class and I'm trying to inject into that class (just a logger), but it never gets injected.
      I also have a custom exception handler in my JSF (using exception-handler-factory in my faces-config.xml) and am trying to inject into that (again, a logger).


      Could it be because these classes are created by the container and simply instantiated, rather than anything else? I'm asking because I've been fixing my custom Factory classes - the classes they produced weren't being injected into because I instantiated the classes myself (rather than let Weld find me an instance). Once I did that, they work. But these classes are outside my control.


      Barring my hypothesis, is there a way for forcing these classes to become managed and hence be injectable?


      Thanks,


      Ian