I am using Camunda spring boot starter version 7.18.0 and graalvm.js version 22.3.0.
To load another javascript file from a script i am setting polyglot.js.load-from-classpath to true and loading it with load(‘classpath:javascript/another.js’);
This works fine when i run it in IntelliJ but throws an error when running it as a jar.
org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script while executing activity 'Event_1g7ttn3' in the process definition with id 'con_process:1:e252851d-dcea-11ed-b8f3-2e0da7043a58':org.graalvm.polyglot.PolyglotException: java.nio.file.InvalidPathException: Illegal char <:> at index 9: classpath:javascript/another.js
I have debugged this for quite a while already and it seams, that graal is using
ClassLoader.getSystemResourceAsStream
to load the resource and not for example
Thread.currentThread().getContextClassLoader().getResourceAsStream
Can you help me find a solution, that works in both cases? I looked at nashorn compatibility mode but don’t really want to go that route if i can prevent it.