OH 5.0.3 and Javascript ruleproblems *all* js rules after update

Hi all,

im using OH since a long update history and updated to 5.0.3 on my dockerbased installation (arm64).

the problem is related to addon “Javascript Scripting“ which impacts all rules im using.

the problem: no rule is working anymore with errormessage:


 UNINITIALIZED

 **HANDLER_INITIALIZING_ERROR**

 Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.267 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule a2ca234fc9: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.278 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule ba681445d1: Failed to compile action: 1(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.282 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 28b978c186: Failed to compile action: 1(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.286 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 250b7ccce9: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.294 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 43b646cf4d: Failed to compile action: 1(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.315 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 18243e2718: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.334 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 0f54c1355b: Failed to compile action: 3(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.350 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 6e79cb7e9e: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.355 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 79dc88fb2e: Failed to compile action: 1(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.361 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule 764d3db85e: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)
2025-11-27 09:06:08.369 \[ERROR\] \[e.automation.internal.RuleEngineImpl\] - Failed to compile rule waermebedarf: Failed to compile action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine)

what i tried:

  • uninstall addon javascript and reinstall - no change
  • restart OH - no change

is there something known what i should do?
in release notes Release openHAB 5.0.3 · openhab/openhab-distro · GitHub i did not read something about changes with javascript addon. Until 5.0.2 all was working fine.

Could someone give me a hint what i can do to avoid this?

can you post the entire log file. The logs you posted are just showing that JSScripting can’t be initialized. Maybe there are some more hints about the reason in the entire log file.

Hi Holger,
thanks for your reply but could you tell me what i could grep the log for because from privacy-reason i dont want to post the full logfile

Anything with the loglevel ERROR and WARN

grep ERROR openhab.log >errors251127.log

attached

errors251127.log (23.6 KB)

here you see some more errors

2025-11-27 09:06:03.851 [ERROR] [t.ScriptTransformationServiceFactory] - bundle org.openhab.core.automation.module.script:5.0.3 (164)[org.openhab.core.automation.module.script.ScriptTransformationServiceFactory(104)] : The setScriptEngineFactory method has thrown an exception
2025-11-27 09:06:03.987 [ERROR] [al.provider.ScriptModuleTypeProvider] - bundle org.openhab.core.automation.module.script:5.0.3 (164)[org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider(112)] : The setScriptEngineFactory method has thrown an exception
2025-11-27 09:06:05.145 [ERROR] [t.internal.HomeAssistantPythonBridge] - bundle org.openhab.binding.mqtt.homeassistant:5.0.3 (312)[org.openhab.binding.mqtt.homeassistant.internal.HomeAssistantPythonBridge(460)] : Error during instantiation of the implementation object
2025-11-27 09:06:05.233 [ERROR] [ric.internal.MqttThingHandlerFactory] - bundle org.openhab.binding.mqtt.homeassistant:5.0.3 (312)[org.openhab.binding.mqtt.homeassistant.generic.internal.MqttThingHandlerFactory(459)] : Error during instantiation of the implementation object: Unable to get service for reference $004
2025-11-27 09:06:05.306 [ERROR] [t.internal.HomeAssistantPythonBridge] - bundle org.openhab.binding.mqtt.homeassistant:5.0.3 (312)[org.openhab.binding.mqtt.homeassistant.internal.HomeAssistantPythonBridge(460)] : Error during instantiation of the implementation object
2025-11-27 09:06:05.341 [ERROR] [nal.discovery.HomeAssistantDiscovery] - bundle org.openhab.binding.mqtt.homeassistant:5.0.3 (312)[org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery(463)] : Error during instantiation of the implementation object: Unable to get service for reference $001

looks like not only jsscripting is broken. Also HomeAssistantPythonBridge is broken. Thats a strong sign that graalvm is not properly initialized. And this is a sign that something with the installation is broken.

maybe the trace in the beginning of the log file as some more insight.

i tried to verify:

this is a sign that something with the installation is broken.

i switched back to the docker image openhab/openhab:5.0.2
result: all is working fine.

so from my point of view it is not based from my installation which is on docker environment only and the data. the installation is inside the container 5.0.3 - isnt it?

what kind of traces i should enable on 5.0.3 to get more about it?

I updated my docker image from openhab 5.0.2 to 5.0.3 too and everything works for me.

In your logs you see the message “The setScriptEngineFactory method has thrown an exception”. The next line, the exception trace is starting.

Maybe it helps, if you clean the user cache folder.

ok, i have now some good news: after i switched back second time from 5.0.2 to 5.0.3 it runs now without problems. So if im thinking about then it could be that some automatic migration on first update was not working and worked correctly on this secont try, so now all ok and working fine!

so generally summary if someone would have this problem too: switch back to older version and then go again to 5.0.3

but i grepped the older log for that string:

2025-11-26 14:58:40.128 [ERROR] [t.ScriptTransformationServiceFactory] - bundle org.openhab.core.automation.module.script:5.0.3 (164)[org.openhab.core.automation.module.script.ScriptTransformationServiceFactory(96)] : The setScriptEngineFactory method has thrown an exception
java.lang.ExceptionInInitializerError: null
	at org.openhab.automation.jsscripting.internal.GraalJSScriptEngineFactory.createScriptEngine(GraalJSScriptEngineFactory.java:99) ~[?:?]
--
	at org.openhab.core.automation.module.script.ScriptTransformationServiceFactory.setScriptEngineFactory(ScriptTransformationServiceFactory.java:72) ~[?:?]
	at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
--

Thank you very much for your help!