Skip to content

Kotlin Scripting is not possible due to the Quarkus Base Runtime classloader #43271

Open
@ckosmowski

Description

Describe the bug

I am trying to use Kotlin scripting inside my quarkus application. I tried in two ways (using kotlins older jsr223 implementation and the newer ScriptingHost approach). I use a script and i am trying to pass objects of a type that is defined in the classpath of my quarkus application.

Expected behavior

The script is able to execute and load the classes of the objects i pass to it

Actual behavior

The script fails to load the classes. I debugged it until i found that the contexts class loader is always the Quarkus Base Runtime classLoader which is not able to load classes of my application.

How to Reproduce?

  1. Create a quarkus project
  2. Try to execute koltin scripts (either jsr223 oder ScriptingHost)
  3. Try to pass an object to the script execution that is of a non primitive type of a class located in the application itsself.

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions