Closed
Description
Affects: Spring 5.1
Since #20414, Spring uses MethodHandler.Lookup.defineClass
to define proxy classes. However, this method forces the proxy to be defined in the same classloader as the initial class, and this classloader should have a visibility for all the classes used by the proxy (spring-aop, cglib & co).
This is not necessary the case in a restricted environment, or in osgi applications.
In my case, I used to build a custom classloader which provide visibility for such proxies - but I can't use this classloader anymore, although I have control of the defineClass on my classloader.
I'd like t have a way to override the spring-cglib ReflectUtils.defineClass() strategy.