Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationListenerMethodAdapter does not find @Ordered annotation for dynamic proxies #22307

Closed
gviczai opened this issue Jan 25, 2019 · 4 comments
Assignees
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@gviczai
Copy link

gviczai commented Jan 25, 2019

Affects: 5.1.x

Is there a specific reason for ApplicationListenerMethodAdapter to use the "method" variable instead of the "targetMethod" in its constructor when resolving Order annotations?
Because for dynamic proxies, this results in a funny situation: EventListener annotation is present on the target class's method, but the Order annotation must be placed on the interface's method, otherwise it is not found.

...
EventListener ann = AnnotatedElementUtils.findMergedAnnotation(this.targetMethod, EventListener.class);
...
this.order = resolveOrder(method);

later, in resolveOrder():
Order ann = AnnotatedElementUtils.findMergedAnnotation(method, Order.class);

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 25, 2019
@jhoeller jhoeller self-assigned this Jan 25, 2019
@jhoeller jhoeller added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 25, 2019
@jhoeller jhoeller added this to the 5.1.5 milestone Jan 25, 2019
@jhoeller jhoeller added type: enhancement A general enhancement and removed type: bug A general bug labels Jan 25, 2019
@jhoeller
Copy link
Contributor

This will be available in the upcoming 5.1.5.BUILD-SNAPSHOT, hopefully covering the dynamic proxy scenario as expected now. Please give it an early try if you have the opportunity...

@gviczai
Copy link
Author

gviczai commented Jan 25, 2019

Sorry, no opportunity here. :( We are using the 4.3 branch. I've just checked the master and saw that this bug still present, so I thought I report it...

@jhoeller
Copy link
Contributor

No worries, thanks for reporting it! Stay tuned in any case, we might be able to backport this for the 4.3.23 release.

@jhoeller
Copy link
Contributor

FWIW, this is available in 4.3.23.BUILD-SNAPSHOT from https://repo.spring.io/snapshot as well now. Please note that the 4.3.23 release is only scheduled for late March; feel free to give the snapshot a try before...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants