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
SynthesizedAnnotation must be public [SPR-13057] #17649
How do you go about using Spring Boot 1.3.0.BUILD-SNAPSHOT?
I've set it in my Maven POM, but I'm getting strange errors when trying to run it.
Caused by: java.lang.IllegalAccessError: class org.springframework.core.annotation.$Proxy62 cannot access its superinterface org.springframework.core.annotation.SynthesizedAnnotation
Analysis
The SynthesizedAnnotation must be public so that non-public annotations from different packages can be proxied.
Sam, I tried to write a unit test by moving the annotations to the subpackage package but couldn't reproduce. I confirm that Boot's build is restored if that interface is made public.
I am assigning that back to you to write the proper test for this issue. Thanks!
Thanks for investigating this and pushing the fix so quickly!
I'm fine with SynthesizedAnnotation being public. I was perhaps a bit overly (unnecessarily) cautious in not doing so in the first place. Besides, SpringProxy is also public. So it's probably a requirement that I simply overlooked.
It turns out that it is in fact a requirement that I overlooked.
Straight from the Javadoc for java.lang.reflect.Proxy.getProxyClass().
All non-public interfaces must be in the same package; otherwise, it would not be possible for the proxy class to implement all of the interfaces, regardless of what package it is defined in.
Plus, I was able to produce a fully reflection-based test that reproduces the issue (although with a slightly different stack trace). Commit coming soon.
Activity
spring-projects-issues commentedon May 22, 2015
Stéphane Nicoll commented
this broke Spring Boot's build. Looking at it now.
spring-projects-issues commentedon May 22, 2015
Stéphane Nicoll commented
Sam, I tried to write a unit test by moving the annotations to the
subpackagepackage but couldn't reproduce. I confirm that Boot's build is restored if that interface is made public.I am assigning that back to you to write the proper test for this issue. Thanks!
spring-projects-issues commentedon May 22, 2015
Sam Brannen commented
Hi Stéphane Nicoll,
Thanks for investigating this and pushing the fix so quickly!
I'm fine with
SynthesizedAnnotationbeingpublic. I was perhaps a bit overly (unnecessarily) cautious in not doing so in the first place. Besides,SpringProxyis alsopublic. So it's probably a requirement that I simply overlooked.Cheers,
Sam
spring-projects-issues commentedon May 22, 2015
Sam Brannen commented
As for writing a proper test for this scenario, I'll see what I can cook up. ;)
spring-projects-issues commentedon May 22, 2015
Sam Brannen commented
It turns out that it is in fact a requirement that I overlooked.
Straight from the Javadoc for
java.lang.reflect.Proxy.getProxyClass().Plus, I was able to produce a fully reflection-based test that reproduces the issue (although with a slightly different stack trace). Commit coming soon.
- Sam
spring-projects-issues commentedon May 22, 2015
Sam Brannen commented
Added test that verifies the requirement that
SynthesizedAnnotationbe public in commit: e7ea925