Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-456

When multiple interceptors are defined for a bean OWB does NOT correctly remove the overriden base Interceptors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0-alpha-2
    • 1.0.0, 1.1.0
    • None
    • Windows Server 2003

    Description

      EJB 3.0 spec. mandates that

      • If a bean class has superclasses, any AroundInvoke methods defined on those superclasses are invoked, most general superclass first.
      • If an AroundInvoke method is overridden by another method (regardless of whether that method is itself an AroundInvoke method), it will not be invoked

      In some cases OWB does not remove the overriden parent interceptor from the Interceptor stack of a bean leading to TCK failures like these ...

      @Test
      @SpecAssertions(

      { @SpecAssertion(section = "1", id = "i"), @SpecAssertion(section = "3", id= "b"), @SpecAssertion(section = "3.1", id= "c"), @SpecAssertion(section = "3.1", id= "d"), @SpecAssertion(section = "3.1", id= "e"), @SpecAssertion(section = "3.1", id= "f"), @SpecAssertion(section = "3.1", id= "g"), @SpecAssertion(section = "8", id = "e") }

      )
      public void testInvocationOrder()

      { ... assert !Interceptor1.isOverridenMethodCalled(); // Error here }

      Error:
      java.lang.AssertionError
      at org.jboss.jsr299.tck.interceptors.tests.aroundInvoke.order.InvocationOrderTest.testInvocationOrder(InvocationOrderTest.java:43)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      In this case
      @Interceptors(

      { Interceptor1.class, Interceptor3.class }

      )
      class Tram extends RailVehicle {
      }

      Inspite of Interceptor1 overriding OverridenInterceptor we see OverridenInterceptor.intercept being called.
      org.jboss.jsr299.tck.interceptors.tests.aroundInvoke.order.InvocationOrderTest is the failing TCK test.

      Attachments

        1. OWB-456.patch
          16 kB
          Rohit Dilip Kelapure

        Activity

          People

            covener Eric Covener
            kelapure Rohit Dilip Kelapure
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified