Hi,
It was already answered why that error happens in the previous thread.
As for the other questions:
- No, but Nashorn will go away when ZAP starts targeting newer Java
versions.
- Yes, but the error is not caused by the missing engine (see previous
thread).
- Remove the GraalVM JavaScript add-on.
You are not doing anything wrong just the assumption that you can use
ZAP classes/Java from the script is not correct for Graal as Zest does
not configure the engine to allow that (as mentioned in the previous
thread).
Best regards.
On 07/06/2024 17:44, Hector Luna wrote:
> So I did mention in a different thread that I am having issues with loading
> scripts into ZEST scripts. Namely, where I have a ZEST script that attempts
> to load a nashorn script via "script action."
>
> This used to work really well in all the builds prior to v2.15.0 and now
> that the latest version is out I keep getting the following error:
>
> *javax.script.ScriptException: org.graalvm.polyglot.PolyglotException:
> ReferenceError: java is not defined*
>
> *Action: failed: javax.script.ScriptException:
> org.graalvm.polyglot.PolyglotException: ReferenceError: java is not defined*
>
> Note that I am using *
ghcr.io/zaproxy/zaproxy:weekly* as the image to run
> my tests and to make sure that it isn't an issue with my own image.
>
> My questions are as follows:
>
> - Is nashorn deprecated in v2.15.0?
> - Isn't graalvm already included in the image?
> - How do I make this work?