Hi all, I recently built a little app where I wanted to demonstrate method interception with CDI (OWB). Therefore I created a (really simple) transaction interceptor.
In the sample app there is a service layer with a basic and a special service interface (GenericService --> CustomerService). The basic service interface uses generics (e.g. public interface GenericService<T> ). I put the @MyTransactional interceptor binding on the methods in the implementation class (e.g. CustomerServiceImpl). Here it turned out that interception does not work on methods where I used the generic type as parameter (e.g.: void delete(T obj); ). Furthermore it does work if the method has no parameter or if I override the method in the special interface (e.g. if I define void delete(Customer customer) in the CustomerService interface) I created a little test app to retest this scenario 3 tests (svn link at [1]) 1. test a method with no parameter - will succeed 2. test a method with a parameter but overridden in the CustomerService interface - will succeed 3. test a method with a parameter and just defined in the GenericService interface - will fail I investigated a little bit on this problem - but I get stucked at the InterceptorHandler#invoke method - there it seems that a "wrong" method is being called - one with the signature "void delete(java.lang.Object)" instead of "void delete(Customer)". It seems a little bit weird to me at all that there is a method with the java.lang.Object as parameter (in the runtime type) - since this is not defined anywhere (is this a compiler problem with generics and type erasure ?). Would be great if anyone has an idea how to solve that issue (without using above mentioned workarounds). regards Berthold [1] svn repo: * http://bs-owb-sandbox.googlecode.com/svn/trunk/owb-interceptors-test*
