You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 7, 2020. It is now read-only.
I'm using the JSR223 scripting engine with some Groovy scripts to update the state of some items with Thing status and firmware information. That all works well. However when I start openHAB 2.2.0 the scripts are loaded before the DefaultScriptScopeProvider is fully initialized.
This results in the following error:
21:23:58.192 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/test.groovy': javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: things for class: Script1
When the runtime has fully started and I save the same script the error does not occur.
The text was updated successfully, but these errors were encountered:
As we don't know when the whole platform is initialized, the ScriptFileWatcher currently waits for 25 seconds before importing the scripts located at the jsr223 directory.
It seems this delay is not enough in your case. It might be a good idea to make this delay configurable.
Another option would be the following: You define a 000_burntime.groovy which just "burns" additional time by sleeping for a specific amount of time. As this file will be always loaded first and all scripts are imported sequentially, this would solve your issue.
This is a duplicate of #4324. And it is a really annoying problem, as you have to add a rule with a system startup trigger that touches the groovy file to get it working.
Unfortunately, the rule does not only run at system startup (or openHAB restarts itself from time to time), as I can see that my rules are discarded and added again every now and then.
Since it is indeed a duplicate I'll close this issue. I've solved this issue (and others) for myself with hardware by migrating from a RPi3 to an Intel NUC.
I'm using the JSR223 scripting engine with some Groovy scripts to update the state of some items with Thing status and firmware information. That all works well. However when I start openHAB 2.2.0 the scripts are loaded before the
DefaultScriptScopeProvider
is fully initialized.This results in the following error:
21:23:58.192 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/test.groovy': javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: things for class: Script1
When the runtime has fully started and I save the same script the error does not occur.
The text was updated successfully, but these errors were encountered: