Skip to content

CDI OpenWebBeans implementation incompatibility #711

@jeanouii

Description

@jeanouii

Hi,

I was looking to use SmallRye Fault Tolerance to Apache TomEE for MicroProfile Fault Tolerance.

Unfortunatly I found that it does not work. I wanted to provide a TCK runner within a profile in SmallRye Fault Tolerance to show that it does not work in OpenWebBeans.

I checked the reason and this is because the approach used in SmallRye seems to be not fully supported by OpenWebBeans. At this moment, it is not fully clear if this is fully described in the specification. But definitely I will try to push some TCK tests and submit a PR to clarify.

Interceptor bindings are transitive—an interceptor binding declared by an interceptor binding type is inherited by all components and other interceptor binding types that declare that interceptor binding type.

An interceptor binding type can only be applied to an interceptor binding type defining a subset of its target types. For example, interceptor binding types declared Target(TYPE) may not be applied to interceptor binding types declared Target({TYPE, METHOD}).

Looks like there is a blury area between Interceptor Spec and CDI Spec. Weld supports applying InterceptorBinding on another InterceptorBinding.

It seems to be also supported in OpenWebBeans with Reflection but the specification isn't clear if annotated types should be also supported. See OpenWebbeans code https://github.com/apache/openwebbeans/blob/master/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java#L231

Long story short, I used a quick hack in TomEE and I was wondering if it would make sense to use the same approach in SmallRye so that it works out of the box with Weld and OpenWebBeans or if I keep it this way in TomEE.

https://github.com/apache/tomee/blob/main/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/faulttolerance/MPFaultToleranceCDIExtension.java

Thoughts?

If you guys agree to reverse the approach then I can create a PR with a TCK runner also for OpenWebBeans.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions