Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6292

A Warning should be logged if an interceptor is ignored because of missing configuration

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Major
    • None
    • None
    • None
    • None

    Description

      Every class can be used as interceptor without an annotation. The class must be listed within the ejb-jar.xml deployment descriptor.

      From the spec there are two elements in ejb-jar.xml:

      <!-- definition of Iterceptor classes -->
      <interceptor>
      <interceptor-class>ACLASS</interceptor-class>
      <!--
      no around-invoke needed if the method is unique
      -->
      </interceptor>
      </interceptors>
      <!-- the binding to EJB's -->
      <assembly-descriptor>
      <interceptor-binding>
      <ejb-name>*</ejb-name>
      <interceptor-class>ACLASS</interceptor-class>
      </interceptor-binding>
      </assembly-descriptor>

      The problem is that the <interceptor> is needed to define the interceptor class unless the class contains the @AroundInvoke annotation.
      The binding need this to take effect.

      The problem here is that any wrong configuration, like typo in the class name, might have the effect that the interceptor is ignored silent.
      As an enhancement a WARN message should be logged that the interceptor-binding can't find the related interceptor or even a ClassNotFoundException if the class is not available.

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: