You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AnnotatedElementUtils does not find annotations on methods in dynamic proxies [SPR-12703] #17300
The code merged for #16696 has some TODOs in ApplicationListenerMethodAdapter and tests that expose this behavior (removing the call to AnnotationUtils will fail with a NullPointerException).
The ignored tests you linked to have nothing to do with proxies. Rather, the reason they were failing is that AnnotationUtils did not support arbitrary levels of meta-annotations on methods, and this caused the @EventListener not to be seen when used as a meta-meta-annotation. See #17534 for details.
Now, having cleared that up... do you perhaps have any failing tests related to the proxy issue you describe in this issue's description? ;-)
well if you have resolved #17534 and the tests are passing now, I guess we can just say that I took the wrong assumptions and that this one is a duplicate. Or am I missing something?
No, I don't think you're missing something. I just think that you covered two features/bugs in one JIRA issue. ;)
I solved the first one in #17534, and the other one is related to lacking support for interfaces.
In this issue you talk specifically about proxies; however, neither AnnotationUtils nor AnnotatedElementUtils provides explicit support for proxies per se. Rather, AnnotationUtils provides support for finding annotations on methods declared in interfaces, which exactly covers the use case for dynamic proxies that implement an annotated interface. So, with that in mind, I'll change the summary and focus of this issue and remove that duplicated deliverable from #17335.
Activity
spring-projects-issues commentedon Feb 23, 2015
Sam Brannen commented
What type of proxy is being used here: CGLIB, JDK dynamic proxy, or AspectJ LTW?
spring-projects-issues commentedon Feb 23, 2015
Sam Brannen commented
This issue is perhaps a duplicate of #15734 or #17335 and at the very least related to those two issues.
spring-projects-issues commentedon Feb 24, 2015
Stéphane Nicoll commented
JDK proxy. You can find the ignored tests here
Just run them and you'll see by yourself.
spring-projects-issues commentedon Apr 19, 2015
Stéphane Nicoll commented
Is this one still on the agenda? There is a TODO in the event listener infra (new in 4.2) that really does require this fix. Thanks!
spring-projects-issues commentedon Apr 20, 2015
Sam Brannen commented
Yes, this is still on the agenda for 4.2 RC1!
spring-projects-issues commentedon Apr 21, 2015
Sam Brannen commented
This is related to #17534.
spring-projects-issues commentedon Apr 21, 2015
Sam Brannen commented
The ignored tests you linked to have nothing to do with proxies. Rather, the reason they were failing is that
AnnotationUtilsdid not support arbitrary levels of meta-annotations on methods, and this caused the@EventListenernot to be seen when used as a meta-meta-annotation. See #17534 for details.Now, having cleared that up... do you perhaps have any failing tests related to the proxy issue you describe in this issue's description? ;-)
spring-projects-issues commentedon Apr 22, 2015
Stéphane Nicoll commented
well if you have resolved #17534 and the tests are passing now, I guess we can just say that I took the wrong assumptions and that this one is a duplicate. Or am I missing something?
spring-projects-issues commentedon Apr 22, 2015
Sam Brannen commented
No, I don't think you're missing something. I just think that you covered two features/bugs in one JIRA issue. ;)
I solved the first one in #17534, and the other one is related to lacking support for interfaces.
In this issue you talk specifically about proxies; however, neither
AnnotationUtilsnorAnnotatedElementUtilsprovides explicit support for proxies per se. Rather,AnnotationUtilsprovides support for finding annotations on methods declared in interfaces, which exactly covers the use case for dynamic proxies that implement an annotated interface. So, with that in mind, I'll change the summary and focus of this issue and remove that duplicated deliverable from #17335.Sound good?
Cheers,
Sam
spring-projects-issues commentedon Apr 22, 2015
Sam Brannen commented
Resolving as a "Duplicate" of #17335.
In addition, support for finding annotations at the type level on interfaces is addressed by #17537.