Skip to content

Conversation

@Postremus
Copy link
Member

The FSP are discovered using the system classloader. if a custom provider tries to load classes using Thread.currentThread().getContextClassLoader().loadClass a ClassCastException is thrown.

Same idea as was originally done in quarkusio/quarkus#9774.
Moving the fix over to this lib, since I want to get rid of it in ClassPathUtils for future optimizations.

break;
final ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try {
// We are loading "installed" FS providers that are loaded from from the system classloader anyway
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// We are loading "installed" FS providers that are loaded from from the system classloader anyway
// We are loading "installed" FS providers that are loaded from the system classloader anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@Postremus
Copy link
Member Author

@Postremus Postremus requested a review from gsmet December 17, 2021 06:33
@gsmet gsmet merged commit 0ed784e into quarkusio:main Dec 18, 2021
@gsmet
Copy link
Member

gsmet commented Dec 18, 2021

I released 0.0.4, you'll need to wait until it's synced to Maven Central.

@Postremus Postremus deleted the provider-with-syscl branch December 18, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants