1 Reply Latest reply on Jun 25, 2006 9:50 AM by lucluc

    Default interceptors bad behaviour

    lucluc

      Win xp, jdk 1.5_04, EJB3 embeddable alfa8.

      Default interceptors, specified in ejb-jar.xml file, are always called even after method interceptor.
      Default interceptors, unless a different specified ordering, should be called before method interceptor.
      Instead, from release alfa8 they are called both before and after.

      I can provide sample code for this, maybe in Jira.

      Regards
      F

        • 1. Re: Default interceptors bad behaviour
          lucluc

          I think it's a bug.

          My sample application Log is:

          INFO 25-06 15:37:52,781 (EJB3StandaloneBootstrap.java:loadMBeanServer:408) -!!loadMBeanServer servers 0
          INFO 25-06 15:37:52,781 (EJB3StandaloneBootstrap.java:loadMBeanServer:411) -!!loadMBeanServer creating...
          WARN 25-06 15:37:53,453 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
          INFO 25-06 15:37:54,953 (Ejb3DescriptorHandler.java:addClassAnnotation:1699) -adding class annotation javax.interceptor.Interceptors to org.jboss.tutorial.interceptor.bean.SampleBean org.jboss.ejb.InterceptorsImpl@435a3a
          INFO 25-06 15:37:54,968 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 609
          INFO 25-06 15:37:55,000 (MCKernelAbstraction.java:install:84) -installing bean: jboss.j2ee:jar=bin,name=SampleBean,service=EJB3 with dependencies:
          INFO 25-06 15:37:55,312 (EJBContainer.java:start:553) -STARTED EJB: org.jboss.tutorial.interceptor.bean.SampleBean ejbName: SampleBean
          Starting
          *** DefaultInterceptor intercepting sample
          *** TracingInterceptor intercepting sample
          *** SampleInterceptor intercepting sample
          *** DefaultInterceptor intercepting sample
          *** TracingInterceptor intercepting sample
          sample called
          *** TracingInterceptor invocation of org.jboss.tutorial.interceptor.bean.SampleBean.sample() took 0ms
          *** DefaultInterceptor exiting
          *** SampleInterceptor exiting
          *** TracingInterceptor invocation of org.jboss.tutorial.interceptor.bean.SampleBean.sample() took 0ms
          *** DefaultInterceptor exiting
          Done


          Why default interceptors (DefaultInterceptor and TracingInterceptor) are called a second time after method interceptor (SampleInterceptor)?


          Ejb-jar.xml content is

          <ejb-jar version="3.0">
          <assembly-descriptor>
          <!-- Default interceptor that will apply to all methods for all beans in deployment -->
          <interceptor-binding>
          <ejb-name>*</ejb-name>
          <interceptor-class>
          org.jboss.tutorial.interceptor.bean.DefaultInterceptor
          </interceptor-class>
          <interceptor-class>
          org.jboss.tutorial.interceptor.bean.TracingInterceptor
          </interceptor-class>
          </interceptor-binding>

          </assembly-descriptor>
          </ejb-jar>


          Should I post to Jira?
          Thanks in advance.
          Regards