The @org.springframework.context.event.EventListener annotation doesn't work when @org.springframework.security.access.prepost.PreAuthorize is present on any method of interface implemented by the same class.
Also it is true if @PreAuthorize is present on class method which implements some interface method without annotations.
With this code processBlackListEvent method is never called when publishing BlackListEvent. Also we can place @PreAuthorize annotation to the implementation method and remove it from interface. In this case @EventListener also doesn't work.
If we remove @PreAuthorize then it starting to work again.
The old way with implementing ApplicationListener interface and overriding onApplicationEvent method also works fine.
Affects: 4.2.2
The text was updated successfully, but these errors were encountered:
Ruslan Stelmachenko opened SPR-13866 and commented
The
@org.springframework.context.event.EventListener
annotation doesn't work when@org.springframework.security.access.prepost.PreAuthorize
is present on any method of interface implemented by the same class.Also it is true if
@PreAuthorize
is present on class method which implements some interface method without annotations.For example:
With this code
processBlackListEvent
method is never called when publishingBlackListEvent
. Also we can place@PreAuthorize
annotation to the implementation method and remove it from interface. In this case@EventListener
also doesn't work.If we remove
@PreAuthorize
then it starting to work again.The old way with implementing
ApplicationListener
interface and overridingonApplicationEvent
method also works fine.Affects: 4.2.2
The text was updated successfully, but these errors were encountered: