Skip to main content

Re: Interceptors and classpaths

  • From: Marina Vatkina <marina.vatkina@...>
  • To: users@...
  • Subject: Re: Interceptors and classpaths
  • Date: Tue, 05 Apr 2011 12:19:37 -0400


jars in an ear will be loaded by their own classloaders. You can inject beans across the jars, but you need to have a common lib with interfaces. You can try to put the interceptor there as well, but I don't think I tested such scenario.


Laird Nelson wrote:
Before I haul off and go waste some time trying to put this together, I thought I'd ask:

Suppose I have two EJB jars in an ear, A and B.

Suppose I have an interceptor class,, in B that I would like to install as an interceptor for an EJB in A. That is, A knows nothing about B or any of its classes, but a B class would like to act as an interceptor for an EJB in A.

If I modify A's ejb-jar.xml (we're talking EJB 3.1 here) so that it lists as an interceptor class, will that class be found?

Finally, since an Interceptor may also be the target of dependency injection, but is tied to the ENC of the bean for which it is an interceptor, can my interceptor-from-B have an instance of A's EJB injected into it?


Interceptors and classpaths

Laird Nelson 04/05/2011

Re: Interceptors and classpaths

Marina Vatkina 04/05/2011
Please Confirm