-
Bug
-
Resolution: Done
-
Major
-
3.1.0.Final
-
None
I'm seeing some weird behavior regarding ProcessAnnotatedType events in Wildfly 15 and 16 Beta1.
I'm deploying an CDI extension contained in a JAR placed in WEB-INF/lib that observers PAT events like this:
public <T> void processAnnotatedType(
@Observes
@Priority(Interceptor.Priority.PLATFORM_AFTER)
@WithAnnotations({Controller.class})
ProcessAnnotatedType<T> pat) {
...
}
A CDI extension in HibernateValidator also observers PAT events:
public <T> void processAnnotatedType(
@Observes
@WithAnnotations({Constraint.class, Valid.class, ValidateOnExecution.class})
ProcessAnnotatedType<T> processAnnotatedTypeEvent) {
...
}
Accoding to my understanding of the spec my extension should fire AFTER the Hibernate Validator extension, because of the use of @Priority for ordering.
Unfortunately this doesn't seem to work correctly. For some reason the observers are notified in random order. So it changes randomly between deployments. Sometimes my extension gets the AnnotatedType which was already modified by the Hibernate Validator extension executed before and sometimes I'm getting an unmodified AnnotatedType and HibernateValidator executed AFTER my extension.
I'm not 100% sure about that, but AFAIK this worked correctly in previous Wildfly versions (11 or 12?).
Any idea what is causing this?