Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1521

Cannot add @Interceptors from extension

XMLWordPrintable

      Scenario:

      I'm trying to add an interceptor to a class in a third-party lib where I can't modify beans.xml.

      As a workaround, I observe ProcessAnnotatedType in a portable extension to add an @Interceptors annotation to the given bean type.

      Problem:

      This causes an exception, apparently due to this piece of code in AbstractClassBean:

      private void initClassDeclaredEjbInterceptors() {
        Class<?>[] classDeclaredInterceptors = null;
        if (getWeldAnnotated().isAnnotationPresent(...)) {
          Annotation interceptorsAnnotation = getType().getAnnotation(...);
                  // ...
        }
      }
      

      The CDI type model is checked for the presence of an annotation, but then the actual annotation is read from the raw class and not from the CDI model.

              mbriskar_jira Matej Briskar (Inactive)
              hwellmann.de Harald Wellmann (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: