gatehill/imposter-cli

Can't switch the JS environment

costajpb opened this issue · 1 comments

Hello!

I've experienced poor performance with the default JS environment. So I decided to give Graal a try, to no avail either in Docker or through the CLI. Letting the CLI download the plugin for the latest version will fail -- according to the release notes, the last time it was released was with version 2.5.4. Hence I downloaded that JAR and set it in the plugins path, but then it complains as follows:

server-imposter-1  | 21:34:40 ERROR i.v.c.i.l.c.VertxIsolatedDeployer - Failed in deploying verticle
server-imposter-1  | java.lang.RuntimeException: Error registering plugin: class io.gatehill.imposter.scripting.graalvm.service.GraalvmScriptServiceImpl
server-imposter-1  |    at io.gatehill.imposter.plugin.PluginManagerImpl.createPlugins(PluginManagerImpl.kt:105) ~[imposter-config-3.22.0.jar:?]
server-imposter-1  |    at io.gatehill.imposter.plugin.PluginManagerImpl.startPlugins(PluginManagerImpl.kt:90) ~[imposter-config-3.22.0.jar:?]
server-imposter-1  |    at io.gatehill.imposter.Imposter$start$1.invokeSuspend(Imposter.kt:131) ~[imposter-engine-3.22.0.jar:?]
server-imposter-1  |    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
server-imposter-1  |    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
server-imposter-1  |    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
server-imposter-1  |    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
server-imposter-1  |    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
server-imposter-1  |    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
server-imposter-1  | Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
server-imposter-1  | 
server-imposter-1  | 1) [Guice/ErrorInjectingConstructor]: IllegalStateException: No language and polyglot implementation was found on the classpath. Make sure the truffle-api.jar is on the classpath.

Would there be any way to get it working, even if I had to downgrade the engine version? Thanks in advance.

Hi @costajpb, thank you for reporting this.

Some recent updates went into the engine (v3.35.0) and the CLI (v0.37.0) that support the use of the GraalVM JavaScript engine properly.

Here is some documentation: https://docs.imposter.sh/scripting_modern_js/