Skip to content

Allow to override the strategy used in ReflectUtils.defineClass #22310

Closed
@j3rem1e

Description

@j3rem1e

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions