Skip to content
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

Plugin: reflection inside plugins fails with class loading errors #8189

Open
jpnovais opened this issue Jan 29, 2025 · 0 comments
Open

Plugin: reflection inside plugins fails with class loading errors #8189

jpnovais opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) plugins

Comments

@jpnovais
Copy link
Contributor

Steps to Reproduce

  1. Build a plugin that uses Jackson with Kotlin module registered
  2. Try to serialize a Kotlin class to JSON

Example of such failing plugin can be found here

Expected behavior:
To correctly serialize the class to JSON

Actual behavior:
Fails with class loading error

class kotlin.jvm.internal.ClassReference cannot be cast to class kotlin.reflect.jvm.internal.KClassImpl (kotlin.jvm.internal.ClassReference is in unnamed module of loader 'app'; kotlin.reflect.jvm.internal.KClassImpl is in unnamed module of loader java.net.URLClassLoader @7cfac39f)

Frequency:
Always

Versions (Add all that apply)

  • Software version: docker image hyperledger/besu:25.1.0

Additional Information

As a workaround, if we override Besu CLASSPATH to include the plugin's folder, all classes are loaded inside the main classloader and the problem goes away.

CLASSPATH=/opt/besu/lib/*:/opt/besu/plugins/*
@jpnovais jpnovais added the bug Something isn't working label Jan 29, 2025
@jflo jflo added the P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) plugins
Projects
None yet
Development

No branches or pull requests

3 participants