Hi Jacek,

There you go! It's a maven project so simply run it with: mvn test

You'll see that the second test will fail when it shouldn't...

Christian

On Sun, Jan 3, 2010 at 1:18 PM, Jacek Laskowski <jacek@laskowski.net.pl> wrote:
On Wed, Dec 30, 2009 at 2:24 AM, Christian Bourque
<christian.bourque@gmail.com> wrote:

> I'm having a problem with a session bean and the latest version of OpenEJB
> (3.1.2): my method interceptor is never called by the container, if I change
> it to a class level interceptor it works as expected!
>
> This doesn't work:
>
> @Local(Test.class)
> @Stateless
> public class TestBean extends ... implements Test
> {
>     @Override
>     @Interceptors(TagInterceptor.class)
>     public Entity makePersistent(Entity entity) { ... }
> }

Hi Christian,

I've been looking into it and couldn't figure out what might've caused
the issue. I've even made some changes to the interceptor example [1]
to reproduce the issue with no joy hence your help is greatly
appreciated to hunt it down. Could you give the example a try with

mvn clean test

and see if it works for you. I'm sure it will, so change it so it
reflects your failing example or send the failing example to the
mailing list as an attachment (if you can't, send it to my mailbox -
jlaskowski...apache.org). I'd love giving it a try myself.

A couple of notes while I was looking into the issue:

1. @Override can only be declared if you override a method from a
parent class. It seems the TestBean class overrides a method from a
parent class (commented out unfortunately) as well as implements the
method from the Test intf. Is this a case?

2. TagInterceptor.class can only have a single @AroundInvoke-annotated
method. Is this a case? (I'm not sure if openejb validates it)

3. How do you execute your bean?

[1] http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/interceptors

Jacek

--
Jacek Laskowski
Notatnik Projektanta Java EE - http://wszystkojawne.pl
p.s. Szukam speca/firmy od grafiki/CSS/HTML