Skip to content

Use beanClassLoader in the HTTP Service Registrar #34846

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

Closed
rstoyanchev opened this issue Apr 30, 2025 · 1 comment
Closed

Use beanClassLoader in the HTTP Service Registrar #34846

rstoyanchev opened this issue Apr 30, 2025 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

For loading user-provided classes, we should use the beanClassLoader, which may be higher level than our framework ClassLoader.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Apr 30, 2025
@rstoyanchev rstoyanchev added this to the 7.0.0-M5 milestone Apr 30, 2025
@rstoyanchev rstoyanchev self-assigned this Apr 30, 2025
philwebb added a commit to philwebb/spring-framework that referenced this issue Apr 30, 2025
Update interface client code to replace `GroupsMetadata.loadClass` calls
with `ClassUtils.resolveClassName` passing in the bean class loader.

Since the bean class loader in injected after construction, some minor
refactoring has been applied to `HttpServiceProxyRegistryFactoryBean`.
The class now stores `GroupsMetadata` and only loads the types in
in `afterPropertiesSet`.

The `HttpServiceProxyFactory` class has also been updated to ensure
that the proxy is created using the class loader of the service
type, rather than the thread context class loader.

Fixes spring-projectsgh-34846
@philwebb
Copy link
Member

3a718e8 can be cherry-picked to hopefully fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants