You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Prasad Kashyap <go...@gmail.com> on 2007/04/09 15:57:56 UTC

Re: Does dependency injection in a interceptor class work ?

Updating thread with answer.

Dependency injection in interceptors do not work (yet).

See David Blevin's response here
http://www.nabble.com/forum/ViewPost.jtp?post=9834975&framed=y&skin=2756

Cheers
Prasad

On 3/20/07, Prasad Kashyap <go...@gmail.com> wrote:
> https://issues.apache.org/jira/secure/attachment/12353787/Interceptor-v2.patch
>
> In the patch above, there is a ClassInterceptor.java which is an
> interceptor class for the BasicStatelessInterceptedBean and
> BasicStatefulInterceptedBean.
>
> This class tries a dependency injection of the SessionContext using
> the @Resource annotation.
>
> In the @PostConstruct callback, I can see that the dependency
> injection has failed. The variable is null.
>
> (Note: This interceptor has a super class. As mentioned in another
> thread, the lifecycle interceptor callbacks is failing in the chaining
> order. Either remove the superclass or move this dependency injection
> to the superclass - SuperInterceptor.java)
>
> Cheers
> Prasad
>