-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Auto-proxy creation should not consider GroovyObject as a user-specified interface [SPR-11715] #16337
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
Comments
Juergen Hoeller commented This looks like a proxy type mismatch, probably caused by your MethodValidationPostProcessor creating an interface proxy (for whatever interface it seems to detect here - could be an implicit Groovy interface)... Does it help to call setProxyTargetClass(true) on your MethodValidationPostProcessor bean? Juergen |
Juergen Hoeller commented After some quick review here, it does seem like the presence of the GroovyObject interface on a Groovy bean class makes AbstractAdvisingBeanPostProcessor choose interface proxies - in that case, a proxy that just implements the GroovyObject interface :-( In any case, setProxyTargetClass(true) should solve the immediate problem here. If it does, I'll turn this issue into a general AbstractAutoProxyCreator / AbstractAdvisingBeanPostProcessor enhancement to be smarter about GroovyObject there, not considering it as a user-specified interface and therefore choosing target-class proxies automatically if GroovyObject is the only interface being implemented. Juergen |
Oliver Drotbohm commented This seems to be a general issue with the eligibility check in |
Abhijit Sarkar commented
|
Abhijit Sarkar commented Instead of targeting the |
Juergen Hoeller commented Actually, since there are a few strategy interfaces in Juergen |
Juergen Hoeller commented AbstractAutoProxyCreator and AbstractAdvisingBeanPostProcessor consistently don't consider configuration callbacks and internal language interfaces as reasonable proxy interfaces now, through reusing the evaluateProxyInterfaces algorithm from a new common ProxyProcessorSupport base class. This includes exclusion of the GroovyObject interface; to be extended for any further well-known language interfaces that are just meant for internal use. Juergen |
Abhijit Sarkar opened SPR-11715 and commented
Groovy application with JSR-303 bean validation. Configured
MethodValidationPostProcessor
andLocalValidatorFactoryBean
in groovybeans
along with other beans. Application fails to start due to DI failure for beans using JSR-303 validation.Relevant classes below. Actually using
4.0.4.BUILD-SNAPSHOT
but JIRA won't let me choose that.service-config.groovy
MovieRipService.groovy
MovieFacade.groovy
Affects: 3.2.8, 4.0.3
Issue Links:
The text was updated successfully, but these errors were encountered: