2 Replies Latest reply: Mar 23, 2012 8:11 AM by Christian Kölle RSS

Problem with interceptor on non-EJBs and abstract super classes

Christian Kölle Newbie

I have implemented a CDI interceptor as described in http://docs.jboss.org/weld/reference/1.1.0.Final/en-US/html/interceptors.html. These classes are packaged in a non-EJB jar with beans.xml in META-INF. I have also an EJB jar with beans.xml. Both jars are deployed in the same ear. The structure is like this:

 

myEar.ear

  lib/common.jar

commonEJB.jar

 

The ear is deployed in a JBoss 7.1 application server.

 

I now tried to attach my new annotation in different places. My observation is that the interceptor is working only on methods in concrete classes that are annotated with @Stateless or @Stateful. It's not working on other POJOs.

 

Furthermore my EJBs inherit from abstract base classes. Placing the annotation on a method in the base class does not work either.

 

I've read a lot of documentation and didn't find a hint that my approach is not valid.

 

Any hints?

Christian